Python - Import error: DLL Load failed: %1 is not a valid win32 application

社会主义新天地 提交于 2019-12-12 00:10:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!