I do start P圜harm with the batch-file in P圜harms bin directory, called by a custom Script to set the needed environment variables, allowing to make QGIS-Plugins with Qt and QGIS-Standalone-Applications. I think it will be easy to change it for QGIS2/Python2.7 or anything with 64bit. My OSGEO4W is 32bit and uses QGIS3/Python3. I am not sure if I did it correctly, but it doesn't solve the problem:Īt least i managed to start Pycharm with an OSGEO4W Environment. SET PYTHONPATH=%PYTHONPATH% %OSGEO4W_ROOT%\apps\Python36\DLLs SET PYTHONPATH=%PYTHONPATH% %OSGEO4W_ROOT%\apps\Python36\Lib\site-packages SET PYTHONPATH=%PYTHONPATH% %OSGEO4W_ROOT%\apps\Python36\lib SET PYTHONPATH=%PYTHONPATH% %OSGEO4W_ROOT%\apps\Python36\Scripts SET PYTHONPATH=%PYTHONPATH% %OSGEO4W_ROOT%\apps\Python36 I now created two batch files as Andreas Müller suggested in the comment above. This is not a working answer, just an extended reply to the comment above from Andreas Müller. Fixing "The SDK seems invalid" error when setting up P圜harm and PyQGIS?.
However, I am a little uncertain what should really go into PATH, PYTHONPATH, PYTHONHOME and PYTHON. Start "P圜harm aware of QGIS" /B %PYCHARM% %*Ģ) I modified the Windows environment variables to the folders indicated above (C:\OSGeo4W64\bin.). SET PYTHONPATH=%PYTHONPATH% %OSGEO4W_ROOT%\apps\qgis-dev\python SET PYTHONPATH=%PYTHONPATH% %OSGEO4W_ROOT%\apps\Python27\DLLs SET PYTHONPATH=%PYTHONPATH% %OSGEO4W_ROOT%\apps\Python27\Lib\site-packages SET PYTHONPATH=%PYTHONPATH% %OSGEO4W_ROOT%\apps\Python27\Lib SET PYTHONPATH=%PYTHONPATH% %OSGEO4W_ROOT%\apps\Python27\Scripts SET PYTHONPATH=%PYTHONPATH% %OSGEO4W_ROOT%\apps\Python27 SET PYTHONPATH=%PYTHONPATH% %OSGEO4W_ROOT%\apps\qgis\python SET PYTHONPATH=%PYTHONPATH% %OSGEO4W_ROOT%\apps\qgis SET PATH=%PATH% %OSGEO4W_ROOT%\apps\qgis\bin SET PYCHARM="C:\Program Files (x86)\JetBrains\P圜harm Community Edition 2016.3.1\bin\pycharm.exe" However, none of this works, the error always looks like here below, where I tried to add C:\OSGeo4W64\bin\python.exeĪfter reading through some blogs and questions (links below), here is what I tried:ġ) I created this pycharm-pyqgis.bat file below, that I am now using to start P圜harm.
exe files from C:\OSGeo4W64\apps\Python27 and C:\OSGeo4W64\apps\Python36 as Python interpreters. I thought this might be possible by setting the. Ideally, I would like to be able to switch between both Python2 and Python3 in P圜harm. I am having trouble adding a QGIS-specific Python interpreter to P圜harm.