I have built QGIS 3.2.0 with the release code downloaded from GitHub, using CMake and Visual Studio 2017. Basically I followed the instructions in INSTALL
file. When I run QGIS.exe, it shows:
Couldn't load PyQGIS.
Python support will be disabled.
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'qgis'
Python version:
3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)]
QGIS version:
3.2.0-Bonn 'Bonn', exported
Python path:
['I:/OSGeo4W64/apps/qgis/./python', 'H:/Users/Aurus/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python', 'H:/Users/Aurus/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python/plugins', 'I:/OSGeo4W64/apps/qgis/./python/plugins', 'I:\\OSGeo4W64\\bin\\python36.zip', 'I:\\OSGeo4W64\\apps\\Python36\\DLLs', 'I:\\OSGeo4W64\\apps\\Python36\\lib', 'I:\\qgis\\bin', 'I:\\OSGeo4W64\\apps\\Python36', 'I:\\OSGeo4W64\\apps\\Python36\\lib\\site-packages']
And:
An error occurred during execution of following code:
qgis.utils.uninstallErrorHook()
Traceback (most recent call last):
File "", line 1, in
NameError: name 'qgis' is not defined
Python version:
3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)]
QGIS version:
3.2.0-Bonn 'Bonn', exported
Python path:
['I:/OSGeo4W64/apps/qgis/./python', 'H:/Users/Aurus/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python', 'H:/Users/Aurus/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python/plugins', 'I:/OSGeo4W64/apps/qgis/./python/plugins', 'I:\\OSGeo4W64\\bin\\python36.zip', 'I:\\OSGeo4W64\\apps\\Python36\\DLLs', 'I:\\OSGeo4W64\\apps\\Python36\\lib', 'I:\\qgis\\bin', 'I:\\OSGeo4W64\\apps\\Python36', 'I:\\OSGeo4W64\\apps\\Python36\\lib\\site-packages']
I place a qgis.env
on the binary directory with following contents, instead of modifying system environment variables:
PATH=I:\OSGeo4W64\apps\qgis\bin;I:\OSGeo4W64\apps\Python36;I:\OSGeo4W64\apps\Python36\Scripts;I:\OSGeo4W64\apps\qt5\bin;I:\OSGeo4W64\apps\Python27\Scripts;I:\OSGeo4W64\bin;H:\WINDOWS\system32;H:\WINDOWS;H:\WINDOWS\system32\WBem
GDAL_DATA=I:\OSGeo4W64\share\gdal
GDAL_DRIVER_PATH=I:\OSGeo4W64\bin\gdalplugins
GDAL_FILENAME_IS_UTF8=YES
GEOTIFF_CSV=I:\OSGeo4W64\share\epsg_csv
JPEGMEM=1000000
OSGEO4W_ROOT=I:\OSGeo4W64
PROJ_LIB=I:\OSGeo4W64\share\proj
PYTHONHOME=I:\OSGeo4W64\apps\Python36
QGIS_PREFIX_PATH=I:/OSGeo4W64/apps/qgis
QT_PLUGIN_PATH=I:\OSGeo4W64\apps\qgis\qtplugins;I:\OSGeo4W64\apps\qt5\plugins
VSI_CACHE=TRUE
VSI_CACHE_SIZE=1000000
O4W_QT_PREFIX=I:/OSGeo4W64/apps/Qt5
O4W_QT_BINARIES=I:/OSGeo4W64/apps/Qt5/bin
O4W_QT_PLUGINS=I:/OSGeo4W64/apps/Qt5/plugins
O4W_QT_LIBRARIES=I:/OSGeo4W64/apps/Qt5/lib
O4W_QT_TRANSLATIONS=I:/OSGeo4W64/apps/Qt5/translations
O4W_QT_HEADERS=I:/OSGeo4W64/apps/Qt5/include
Hope it will be solved.