[GIS] Initialize Remote Debug (QGIS Plugin) for Eclipse (PyDev)

pyqgis

I have used the following guide: http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/ide_debugging.html#debugging-using-eclipse-and-pydev

I have installed the plugin (PyDev) under Eclipse (Version: Luna Service Release 2 (4.4.2)) and also installed the plugin Remote Debug under QGIS (Version 2.14.0).

Up to this point everything worked. Now we come to the problem. In Eclipse debug mode has been started successfully. Subsequently, the remote debug plugin in QGIS has been started. This resulted in an error message: Debugging connection failed.

Subsequently I checked if i can import the module pydevd by: import pydevd. I got the message that the module is unknown. In the previous tutorial, this problem is not treated. Then I looked at the side of PyDev. There is a manual for the Remote Debug Plugin: http://www.pydev.org/manual_adv_remote_debugger.html

The third bullet point from the top is: Start the external program with the file 'pydevd.py' in its pythonpath. Now the question for you, where do I specify this path? The problem is clear, QGIS does not know the PyDev Library. So I have to give QGIS the path to the Library. How do I do that?

Best Answer

The PYTHONPATH must be added to the environment variables. This Path is the folder in which the file pydevd.py is. In my case, this is the following path: C:\eclipse\eclipse\plugins\org.python.pydev_4.4.0.201510052309\pysrc. After restarting, the module pydevd can be imported.

Related Question