I have recently installed QGIS 2.18.19 LTR with the OSGEO464W installer. My system is Windows 7 64bits. I installed Eclipse and PyDev successfully. However when configuring PyDev I have to indicate the 'Interpreter Executable' which in the tutorial I am following would be C:\ProgramFiles\QGIS2.18\bin\python.exe.

If I search the file, I find it in C:\OSGEO4W64\apps\Python36\python.exe, however I am certain that I am running Python 2.7.5 when I check in the python console from inside QGIS and not Python 3. My question is: where can I find the executable or the file that opens the right python 2.7.5, what is the name that I have to provide for the PyDev Interpreter.

enter image description here Below an screen capture


The OSGeo4W (64 bit) provides the Python 3.6 interpreter in the apps folder as another tool, basically if a user wanted to develop in that environment. The default (2.7 64bit) interpreter python.exe is located in the bin folder inside the main OSGeo4W directory.

You can open that in a command prompt to make sure, and it will tell you the version and whether it is 64 or 32 bit. Also in that bin folder, there are *.bat files for both python-qgis-ltr and python-qgis-ltr-dev (you probably intend to use the second one). If you double click either, it will open up that same python interpreter (2.7, 64 bit) with all of the environments set so that you can import qgis core functions and any other modules that you'd otherwise access through the Python Console inside a qgis desktop session.

If you right click the python-qgis-ltr-dev.bat file and select "Edit", you can view the environments that are needed to use these functions and access these modules. This is important, because you will either want to add these paths to your Windows Environments, or add them to your Paths/Environments in Eclipse. Just note that everywhere it says %OSGEO4W_ROOT%, you'll want to replace that with the actual full path to your install directory, e.g. "C:\user\OSGeo4W".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.