[QGIS-Developer] Issues with Importing qgis

Richard Duivenvoorde rdmailings at duif.net
Wed Oct 17 01:39:44 PDT 2018


On 10/16/2018 04:18 PM, Ryan Ruggiero wrote:
> Hello,
> 
> I am seeking help regarding importing ‘qgis.core’ into a standalone
> python script, python executable in cmd, or in a OSGeo4W shell cmd
> executable. I have python 3.7 installed on my machine along with
> OSGeo4W64, QGIS3.2. The current error message I am getting:
> 
> Any help with this issue would be greatly appreciated. My goal with this
> is to use qgis geoprocessing tools in the same manner I am able to use
> the arcpy module to geocode. Most of the solutions online suggested
> adding to the PATH and PYTHONPATH user environmental variables, one of
> them being I have tried adding the location of the ‘qgis._core.dll’
> file, and I still get the same error.

Hi Ryan,

It is not the dll's that your are missing, but the actual QGIS python stuff.

In your PYTHONPATH you have to point to the in my install avaialbe dir:

<YOURINSTALLATION>/share/qgis/python/

THERE you find the python dirs/modules:

console  plugins  pyplugin_installer  qgis  qsci_apis

It should be revealed to you also when you do the following in your
python console:

import sys; print(sys.path)

Hope this helps,

Regards,

Richard Duivenvoorde





More information about the QGIS-Developer mailing list