import os, sys
sys.path.append(r'C:\Program Files\QGIS 3.6\apps\qgis\python')
sys.path.append(r'C:\Program Files\QGIS 3.6\apps\qgis\bin')
sys.path.append(r'C:\Program Files\QGIS 3.6\apps\Python37')
sys.path.append(r'C:\Program Files\QGIS 3.6\apps\Python37\Scripts')
sys.path.append(r'C:\Program Files\QGIS 3.6\apps\Qt5\bin')
sys.path.append(r'C:\Program Files\QGIS 3.6\apps\Python27\Scripts')
sys.path.append(r'C:\Program Files\QGIS 3.6\bin')
sys.path.append(r'C:\Windows\System32')
sys.path.append(r'C:\Windows')
sys.path.append(r'C:\Windows\System32\wbem')
sys.path.append(r'C:\Program Files\QGIS 3.6\apps\Python37\Lib\site-packages\pywin32_system32')
sys.path.append(r'C:\Program Files\QGIS 3.6\apps\Python37\Lib\site-packages\numpy\.libs')
import qgis
I would like to write a standalone QGIS application. My Python file is on the desktop and I would like to access the QGIS functions. At the beginning I had the error import qgis module not found
, which could be solved by the first line of sys.path.append
. Now I get the error:
from PyQt5.QtCore import *
ModuleNotFoundError: No module named 'PyQt5.QtCore'
Although I have appended many different paths to the environment variables, I keep getting this error.
How do I solve this error and use the QGIS functions in a standalone application?
from PyQt5.QtCore import *
in your script or doesimport qgis
raise the error?import qgis
raises the error