Thursday 28 July 2016

python - qgis.core import error


I would want to use the Qgis api for custom desktop application. When I imported the qgis.core module, I get the following error


>>> import qgis.core 
Traceback (most recent call last):
File "", line 1, in
ImportError: DLL load failed: The
specified module could not be found.

A similar error was reported in the forums,im not sure if the exact solution was reached.


Python :ImportError: DLL load failed: The specified module could not be found



Forums do suggest that I would have to use the OSGeo Version of python. How would i get to choose the version of python to use?


I think this could be a path or a pythonpath.Have given my path and python path information below.Let me know if I had missed any of the directories that should be added for qgis core to get its dependencies met.


PATH=C:\Python26;C:\Python26\Scripts;C:\Python26\ArcGIS10.0;C:\Python26\ArcGIS10.0\Scripts;C:\OSGeo4W\apps\qgis-dev\bin


PYTHONPATH=C:\Python26;C:\OSGeo4W\apps\qgis\python;C:\OSGeo4W\apps\python27;C:\Python26\ArcGIS10.0;C:\Python26\Lib\site-packages



Answer



Try using the hints provided in command-line-environment-setup to set up your shell properly before launching your application.


Regards


Tim


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...