Wednesday 5 June 2019

Using PyCharm with QGIS 3?


I've just changed to QGIS 3 and I can't figure out why I can't change from Python 2.7 to Python 3.6 in PyCharm, keep getting invalid SDK! I run this .bat-file:


SET OSGEO4W_ROOT=C:\OSGeo4W64
SET QGISNAME=qgis
SET QGIS=%OSGEO4W_ROOT%\apps\%QGISNAME%
SET QGIS_PREFIX_PATH=%QGIS%
SET PYCHARM="C:\Program Files\JetBrains\PyCharm 2017.1.2\bin\pycharm64.exe"

CALL %OSGEO4W_ROOT%\bin\o4w_env.bat


SET PATH=%PATH%;%QGIS%\bin
SET PYTHONPATH=%QGIS%\python;%PYTHONPATH%

start "PyCharm aware of QGIS" /B %PYCHARM% %*

Answer



I figure it out!


CALL %OSGEO4W_ROOT%\bin\o4w_env.bat called on all .bat files in %OSGEO4W_ROOT%\etc\ini\ and there is the file: python-core.bat


So by changing from python27 to python36 in C:\osgeo4w64\etc\ini\python-core.bat Pycharm find all dependencies :)


EDIT 2018-02-19: After a while away from qgis-master I went back today and had some problems with getting Pycharm working, then I found this post! Really nice and updated!



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...