Python importerror : pyqtconfig - python-2.7

I am trying to install and run Eric4. I get the following error message when i try to open Eric after installation. Could anyone please let me know how to proceed?
--------------------------------------------------------------------------------
2013-07-31, 15:18:59
--------------------------------------------------------------------------------
<type 'exceptions.ImportError'>:
cannot import name pyqtconfig
--------------------------------------------------------------------------------
File "C:\Python27\Lib\site-packages\eric4\eric4.py", line 295, in <module>
main()
File "C:\Python27\Lib\site-packages\eric4\eric4.py", line 207, in main
Startup.setLibraryPaths()
File "C:\Python27\Lib\site-packages\eric4\Utilities\Startup.py", line 195, in setLibraryPaths
from PyQt4 import pyqtconfig
--------------------------------------------------------------------------------
Version Numbers:
Python 2.7
Qt 4.8.4
PyQt4 4.10.2
sip 4.14.7
QScintilla 2.7.2
eric4 4.5.8 (r4410)
Platform: win32
2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)]
Thanks a lot

Sorry for my poor English. After some googling I found that in Pyqt 4.10 and above, pyqtconfig.py seems be removed. Please check http://pyqt.sourceforge.net/Docs/PyQt4/build_system.html#module-PyQt4.pyqtconfig
I added a pyqtconfig.py and sipconfig.py get from web.
After that Eric4 starts (with some errors). Haven't do many operations in the editor yet.

Related

Python 3.6 pyrfc ImportError

I have VM win7 x64, Python 3.6 and Im trying to install pyrfc SAP connector.
I have installed NWRFC library, set it in PATH variable, installed egg pyrfc-1.9.5-py3.5 with easy_install, and installed Visual c++ redistributable 2015 (x64) 14. But import always fails:
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyrfc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36\lib\site-packages\pyrfc-1.9.5-py3.5-win-amd64.egg\pyrfc\__init__.py", line 22, in <module>
from pyrfc._pyrfc import get_nwrfclib_version, Connection, TypeDescription, FunctionDescription, Server
File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36\lib\site-packages\pyrfc-1.9.5-py3.5-win-amd64.egg\pyrfc\_pyrfc.py", line 7, in <module>
__bootstrap__()
File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36\lib\site-packages\pyrfc-1.9.5-py3.5-win-amd64.egg\pyrfc\_pyrfc.py", line 6, in __bootstrap__
imp.load_dynamic(__name__,__file__)
File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
On same machine I have also Python2.7 - its using same NWRFC library and it works with no problem.
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyrfc
>>>
What could be the issue? Or how can I trace the import to know which other library is missing?
On github there are issues related to this, and some people solved it by:
One person reinstalled SAP SDK:
after some troubleshooting at least in my case was fixed after I re-downloaded the SAP SDK making sure I was downloading the Windows version.
Another person said:
If I uninstall pyrfc v2.0.1 and reinstall v1.9.93 using pyrfc-1.9.93-cp37-cp37m-win_amd64.whl, it works even without needing env var SAPNWRFC_HOME.
Try:
pip install pyrfc
It works for me.

Orange 3 - openSUSE 13.1 installation - No widgets

I am having trouble installing Orange3 from github on openSUSE 13.1.
I have all requirements installed: gcc, g++, python 3-devel, pysci, pyqt4devel etc.
I followed these instructions, everything seems to work (with many warnings when compiling), however when entering in Orange.canvas, there are no widgets at all. It seems they have been missing on installation/compilation.
Any idea about what I did miss in the install or requirements?
Thanks for the -l3 options.
All the widgets get the same error on import
File "./Orange/widgets/utils/overlay.py", line 10, in <module>
import enum
ImportError: No module named 'enum'
Could not import 'orangecontrib.datafusion.widgets.owsamplematrix'``
I am not Python specialist, I will check for this module ..

"import wx" fails in PySCripter

I have a 64-bit windows 7 OS where I installed ArcGIS with 64-bit Python 2.7.
I also installed 64 pyscripter editor.
When I import wx from Python 2.7 IDE no isse - I get this:
Python 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
>>> import wx
>>>
>
When I import from PyScripter - fails I get this:
*** Python 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)] on win32. ***
>>> import wx
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Python27\ArcGISx6410.3\lib\site-packages\wx-3.0-msw\wx\__init__.py", line 45, in <module>
from wx._core import *
File "C:\Python27\ArcGISx6410.3\lib\site-packages\wx-3.0-msw\wx\_core.py", line 4, in <module>
import _core_
ImportError: DLL load failed: %1 is not a valid Win32 application.
>>>
Anybody can help me with this?
I think it is installing to the wrong location. Normally when you install Python packages, they get installed to C:\Python27\lib\site-packages. Somehow you installed wxPython to C:\Python27\ArcGISx6410.3\lib\site-packages. I would uninstall wxPython and when you re-run the wxPython installer, specify where to install it.
I should note that wxPython works fine for me on Windows 7 when it is installed in the correct location. I can import wx from both Python's interpreter and in PyScripter.

Error in Spark installation --pyspark

I am installing spark 1.2.1 on windows 8 and I have downloaded a prebuilt package for Hadoop 2.4
When i am running pyspark i am getting the following error:
C:\Users\Dinesh\Desktop\spark-1.2.1-bin-hadoop2.4>bin\pyspark
Running python with PYTHONPATH=C:\Users\Dinesh\Desktop\spark-1.2.1-bin-hadoop2.4\bin\..\python\lib\py4j-0.8.2.1-src.zip;C:\Users\Dinesh\Desktop\spark-1.2.1-bin-hadoop2.4\bin\..\python;
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
The system cannot find the path specified.
Traceback (most recent call last):
File "C:\Users\Dinesh\Desktop\spark-1.2.1-bin-Hadoop2.4\bin\..\python\pyspark\shell.py", line 45, in <module>
sc = SparkContext(appName="PySparkShell", pyFiles=add_files)
File "C:\Users\Dinesh\Desktop\spark-1.2.1-bin-hadoop2.4\python\pyspark\context.py", line 102, in __init__
SparkContext._ensure_initialized(self, gateway=gateway)
File "C:\Users\Dinesh\Desktop\spark-1.2.1-bin-hadoop2.4\python\pyspark\context.py", line 212, in _ensure_initialized
SparkContext._gateway = gateway or launch_gateway()
File "C:\Users\Dinesh\Desktop\spark-1.2.1-bin-hadoop2.4\python\pyspark\java_gateway.py", line 73, in launch_gateway
raise Exception(error_msg)
Exception: Launching GatewayServer failed with exit code 1!
Warning: Expected GatewayServer to output a port, but found no output.
I have searched and i got that in general the error is caused as the path variable are not correctly defined,but i have checked and my variable are all in place. How can i solve the error?
"The system cannot find the path specified." Which path is it talking about.?
In my case the problem came from the terminal I was using. On Git Bash on Windows I was getting the error : line 96: CMD: bad array subscript when executing spark-shell, but when I tried on PowerShell it worked fine.
The way I debugged this issue was to rem the "#echo off" command on all the command files that got called by pyspark.cmd.
In the end I nailed it down to me having JAVA_HOME set to "C:\ProgramData\Oracle\Java\javapath" which is wrong as one of the cmd scripts adds a "\bin" to JAVA_HOME before calling java.exe and it was triggering the "The system cannot find the path specified." error.
So I changed JAVA_HOME to "C:\Program Files\Java\jdk1.8.0_25" and it worked fine.
Now I have to un-rem the "#echo off"s. Hope it helps!
It maybe caused by cygwin in the DOS classpath. Spark uses the find command in the file 'spark-class2.cmd', which used then the cygwin find command instead of the DOS find command, which works somewhat different. I removed cygwin from the DOS PATH, which solved the problem.

Biopython Indentation Error

I've been dabbling in biopython for about a year and I recently upgraded to Biopython release 1.59. I've been refreshing my skills with some tutorials but I always get the error below when I run a for loop and any module from the biopython library:
IndentationError: expected an indented block
I only get this error when I call the .py file written in Komodo Edit version 7.0.2 from the command line terminal:
Priyas-iMac:~ Priya$ python /Users/priya/Documents/Python/Tutorials/BioParse.py
Traceback (most recent call last):
File "/Users/priya/Documents/Python/Tutorials/BioParse.py", line 4, in <module>
SeqIO.write(rc, "/Users/priya/Documents/Python/Tutorials/ls_orchid_rc.fasta", "fasta")
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/SeqIO/__init__.py", line 400, in write
from Bio import AlignIO
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/AlignIO/__init__.py", line 147, in <module>
import NexusIO
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/AlignIO/NexusIO.py", line 19, in <module>
from Bio.Nexus import Nexus
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/Nexus/Nexus.py", line 15, in <module>
import os,sys, math, random, copy
File "/Users/Priya/Documents/Python/Tutorials/random.py", line 27
randLowHigh(5,10)
^
IndentationError: expected an indented block
When I use the command line to call old .py files that I wrote a year ago as above they run fine. And when I start up python directly and type in the tutorial example line by line it works fine:
Priyas-iMac:~ Priya$ python
Python 2.7.3 (default, Apr 19 2012, 00:55:09)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from Bio import SeqIO
>>> for seq_record in SeqIO.parse("/Users/priya/Documents/Python/Tutorials/ls_orchid.txt","fasta"):
... print seq_record.id
...
gi|2765658|emb|Z78533.1|CIZ78533
gi|2765657|emb|Z78532.1|CCZ78532
How can I fix my .py file so I can just run it from the terminal?
Any insight into this problem would be greatly appreciated!
Priya
It turns out that when I was originally learning python, I stupidly named a tutorial file "random.py" to practice making a random number generator. When biopython was importing other required modules, it kept pointing to that file instead of the random library module:
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/Nexus/Nexus.py", line 15, in <module>
import os,sys, math, random, copy
File "/Users/Priya/Documents/Python/Tutorials/random.py", line 27
randLowHigh(5,10)
Thanks for the help, everyone!
Check if all the files and modules imported have the same indentation (tabs or spaces and same number of spaces).
From the Style guide for Python code you can read:
Use 4 spaces per indentation level.
For really old code that you don't want to mess up, you can continue to use 8-space tabs.
And regarding tabs and spaces:
Never mix tabs and spaces.
The most popular way of indenting Python is with spaces only. The
second-most popular way is with tabs only. Code indented with a
mixture of tabs and spaces should be converted to using spaces
exclusively. When invoking the Python command line interpreter with
the -t option, it issues warnings about code that illegally mixes tabs
and spaces. When using -tt these warnings become errors. These options
are highly recommended!
For new projects, spaces-only are strongly recommended over tabs. Most
editors have features that make this easy to do.
Maybe Komodo is changing something automatically (some editors do). Try to edit the file in a more plain editor and look for the tabs. You may have an option to show you the spaces and tabs as visible.
Hope it helps!