First off, I'm working with QGIS 3.4.5, Spyder 3.6 installed through ArcGIS Pro (2.3.2) python package manager on Windows 10. I can't get the qgis.core module to load and I need some help.

I'm trying to work with QGIS modules alongside arcpy modules in a stand alone script. I have tried for a couple days to work through suggestions on other forum posts to no avail. Using the python command window I have set my PYTHONPATH and PATH to the location of my qgis python folder, here:

set PYTHONPATH=C:\Program Files\QGIS 3.4\apps\qgis-ltr\python

set PATH= C:\\Program Files\\QGIS 3.4\\bin

I was able to get the qgis module to load but I am hung up on this DLL load failed error. I'm considering doing an uninstall and reinstalling using the OSgeo4W package installer, maybe that will help? Does anyone have any suggestions? Images of relevant data are below.

Sys.path screenshot

Here is a screenshot of my sys.path

Windows Explorer Screenshot: location for PYTHONPATH


screenshot of the code I'm trying to get to run:

python code

And finally, the error I'm getting:


I have read through many forum posts on this subject including:

Using QGIS3 Processing algorithms from standalone PyQGIS scripts (outside of GUI)

Using processing algorithm 'native:hublines' in standalone QGIS application

QGIS 2.99 "qgis._core import error: DLL load failed"

How to import qgis.core in spyder?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.