I made the environment variables as described here: How2 Import Though I still receive this error:
C:\>python
Python 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import qgis.core
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\OSGeo4W64\apps\qgis\python\qgis\__init__.py", line 27, in <module>
from qgis.core import QgsFeature, QgsGeometry
File "C:\OSGeo4W64\apps\qgis\python\qgis\core\__init__.py", line 30, in <module>
from qgis._core import *
ImportError: DLL load failed: Det angivne modul blev ikke fundet.
>>>
This is my environment PYTHONPATH string:
C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\qgis\include;C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\qgis\python\qgis\core;C:\OSGeo4W64\apps\qgis\bin\qgis_core.dll;C:\OSGeo4W64\apps\qgis\bin;C:\Program Files\QGIS Essen\bin\qgis.bat;C:\OSGeo4W64\apps\Python27\Lib\site-packages;C:\OSGeo4W64\apps\qgis-rel-dev\bin;C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\qgis\python;C:\OSGeo4W64\apps\qgis-dev\bin
As I have checked, "qgis_core.dll" is located in "C:\OSGeo4W64\apps\qgis\bin" which is the first variable.
[Edit] I installed Qgis 2.16 through OSGeo4W
asked Jul 28, 2016 at 7:41
-
1Perhaps the answer to this post might help: Problem with import qgis.core when writing a stand-alone PyQGIS scriptJoseph– Joseph2016年07月28日 09:34:47 +00:00Commented Jul 28, 2016 at 9:34
lang-py