我最近安装了QGIS,我想导入Python的qgis模块。我使用的是Windows7 x64和QGIS2.2 x64。我将路径设置为:
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\mapnik-v2.2.0\lib;C:\mapnik-v2.2.0\bin;C:\Program Files (x86)\QGIS Valmiera\apps\qgis\python;C:\OSGeo4W\bin;E:\Python\GeoDjango\myplanet;E:\Python\GeoDjango\myplanet;C:\Program Files (x86)\QGIS Valmiera\bin;C:\Program Files (x86)\QGIS Valmiera\apps\msys\bin;C:\Program Files (x86)\QGIS Valmiera\apps\Python27;C:\Program Files (x86)\QGIS Valmiera\bin;C:\Program Files (x86)\QGIS Valmiera\apps\qgis\python\qgis;和PYTHONPATH到:
C:\mapnik-v2.2.0\python\2.7\site-packages;E:\Python\GeoDjango\myplanet;C:\Program Files\QGIS Valmiera\apps\qgis\python;C:\Program Files\QGIS Valmiera\apps\Python27\lib;C:\Program Files\QGIS Valmiera\apps\Python27\Lib\site-packages;C:\Program Files\QGIS Valmiera\apps\Python27\DLLs;我仍然得到这个错误:
import qgis
File "C:\Program Files\QGIS Valmiera\apps\qgis\python\qgis\__init__.py", line 35, in <module>
from qgis.core import QgsFeature, QgsGeometry
ImportError: DLL load failed: The specified module could not be found.我使用Dependency Walker跟踪DLL加载的问题。这是Dependency Walker的屏幕截图:

Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.我如何修复这些错误?
发布于 2014-08-15 01:39:36
查看此处:DLL load failed with PyQGIS
import sys
sys.path.extend([r"C:\Program Files\QGIS Valmiera\apps",r"C:\Program Files\QGIS Valmiera\apps\qgis\bin",r"C:\Program Files\QGIS Valmiera\apps\Python27"])
import qgis.core发布于 2017-09-18 21:56:52
我现在使用pycharm作为我的集成开发环境,我的解决方案是将" python -qgis.bat“设置为python解释器,.bat文件的路径是"~\qgis\bin”。查看这个bat文件,您会发现所有路径都已在this.bat文件中设置。希望能对你有所帮助。
发布于 2014-06-19 06:42:59
我是python (和Qgis)的初学者,但我在指南中读到qgis.core不在dll中。第一部分" qgis“是一个目录e,第二部分是您在PYTHONPATH变量中添加的文件"core.pyd”,其中目录是qgis (dir)。对我来说是: PHYTONPATH="C:\Program Files\QGIS \apps\qgis\python“,希望对我有所帮助!!
https://stackoverflow.com/questions/24075340
复制相似问题