问题
I'm using QGIS + Python with the PyQt4 library.
Currently I'm running Python 2.7 32bit in Windows 7 64 bit (I know these by executing sys.architecture())
I download the PyQt4 library from https://www.riverbankcomputing.com/software/pyqt/download for 32bits architecture.
Then I add to the PATH variable: C:\Python27\Lib\site-packages\PyQt4;D:/Program Files/QGIS Essen/apps/qgis/bin;D:/Program Files/QGIS Essen/apps/qgis/python; And set PYTHONPATH = D:/Program Files/QGIS Essen/apps/qgis/python;
The odd thing here is that I manage to make it work yesterday. But now when I want to run it again this error appears:
Edit: code error added
File "main.py"
from qgis.core import *
File "D:\PRogram Files\QGIS Essen\apps\qgis\python\qgis\__init__.py", line 36 in <module>
from qgis.core import QgsFeature, QgsGeometry
File "D:\Program Files\QGIS Essen\apps\qgis\python\qgis\core\__init__.py, line 34 in <module>
from qgis._core import *
ImportErrro: DLL load failed: %1 is not a valid win32 application
Error Screenshot
Any help would be helpfull
来源:https://stackoverflow.com/questions/36682677/python-import-error-dll-load-failed-1-is-not-a-valid-win32-application