[osgeo4w-dev] PYTHONPATH configuration

Stephane Goldstein s.n.g at gmx.com
Mon Aug 30 23:31:01 PDT 2021


Hi. I installed OSGeo4W on computers that already have a Python
installation. Upon launching QGIS, I got a an error for loading the SIP
module:
ImportError: DLL load failed while importing QtCore
The Python search path at the end of the error dialog shows that
site-packages from the Python installation are being loaded before the ones
from OSGeo4W:

C:/Apps/OSGeo4W/apps/qgis/./python
C:/Users/USERNAME/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python
C:/Users/USERNAME/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python/plugins
C:/Apps/OSGeo4W/apps/qgis/./python/plugins
C:\\Apps\\OSGeo4W\\bin\\python39.zip
C:\\Apps\\OSGeo4W\\apps\\Python39\\DLLs
C:\\Apps\\OSGeo4W\\apps\\Python39\\lib
C:\\Apps\\OSGeo4W\\bin

C:\\Users\\USERNAME\\AppData\\Roaming\\Python\\Python39\\site-packages
C:\\Users\\USERNAME\\AppData\\Roaming\\Python\\Python39\\site-packages\\win32
C:\\Users\\USERNAME\\AppData\\Roaming\\Python\\Python39\\site-packages\\win32\\lib
C:\\Users\\USERNAME\\AppData\\Roaming\\Python\\Python39\\site-packages\\Pythonwin

C:\\Apps\\OSGeo4W\\apps\\Python39
C:\\Apps\\OSGeo4W\\apps\\Python39\\lib\\site-packages
C:\\Apps\\OSGeo4W\\apps\\Python39\\lib\\site-packages\\win32
C:\\Apps\\OSGeo4W\\apps\\Python39\\lib\\site-packages\\win32\\lib
C:\\Apps\\OSGeo4W\\apps\\Python39\\lib\\site-packages\\Pythonwin

I've been trying to modify the OSGeo4W PYTHONPATH environment variable on
the .bat files, but have not been successful.

This is the first time that I have this issue. Any explanation on why, and
how to fix it is really appreciated. Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/osgeo4w-dev/attachments/20210831/ccdf8a09/attachment.html>


More information about the osgeo4w-dev mailing list