Sunday 16 September 2018

pyqgis - No Module named qgis


I installed QGIS through OSGeo4W, and I am trying to write a standalone PyQGIS script, however, I am unable to import the qgis, qgis.core, processing ect… modules, as shown in the picture, I get the ‘Import Error: No Module named qgis...


enter image description here


I sought help from the many examples that exist that require you to change your command line path to your python libraries, change your python path to your c:\OSGeo4W\apps\qgis\python ect…


Here is a list of the answers I tried, but, it seems myself and many others are still unable to fix this issue, as I could not get it to acknowledge the existence of those libraries:


Problem with import qgis.core when writing a stand-alone PyQGIS script:



Cannot run standalone QGIS script


Running Custom Applications:



Answer



I am running a batch file first.


call "C:\OSGeo4W64\bin\o4w_env.bat"
set PATH=%PATH%;C:\OSGeo4W64\apps\qgis\bin

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...