[Qgis-developer] Debugging Python plugin with Eclipse: breakpoints do not wotk
Hi Everybody, I'm new on QGis developing and Python and I'm trying to setup a developing environment for building plugins on QGis. My problem is that breakpoints on Eclipse do not work, process does not stop on them. This is what I do to debug: 1) On Eclipse I execute PyDev-Start Debug Server 2) On QGis I press Remote Debug button 3) On Eclipse I then see, under Debug Server [Python Server], a new node named unknown This is what I do to setup plugin and Eclipse project: 1) on C:\Program Files\QGIS Valmiera\apps\qgis\python\plugins I've created a folder named MyFisrtPlugin with all files I need for a basic test. This test work fine in QGis Code is nested by use of TAB 2) on Eclispe I've created a new PyDev project with - Directory = c:\app\Eclipse\Workspace\MyFirstPlugin - grammar version = 2.7 - Interpreter = Python 2.7 - Create links to existing sources - Project External Source Folders = C:\Program Files\QGIS Valmiera\apps\qgis\python\plugins\MyFirstPlugin - Referenced projects = none Here you are in detail what I've done for installing and setup: - I use Windows 7 64 bit - I use QGis 2.2 - I've installed PyDev on Eclipse - Help-Install new software set http://pydev.org/updates; and install PyDev - I've configured PyDev on Eclipse - Windows-Preferences choose page PyDev-Interpreters-Python Interpreter, press new and set - Python 2.7 - C:\Program Files\QGIS Valmiera\bin\python.exe - I've installed on QGis Plugin reloader and Plugin builder - Plugin-Manage and install plugin - Settings: check show also experimental plugin - search for remote debug and install (I did not find, check the following section on how to install) - search for plugin reloader and install - search for plugin builder and install - I've installed on QGis Remote Debug (it is not reachable by Plugin-Manage and install plugin) - download from https://github.com/sourcepole/qgis-remote-debug - copy RemoteDebug folder to C:\Program Files\QGIS Valmiera\apps\qgis\python\plugins - I've enabled Eclipse debugging: - create a general project - go to debug perspective - PyDev-Start debug Server - Open QGis and start Debug Remote - I've made Eclipse understanding QGis API - Click Window=Preferences=PyDev=Interpreter - Python - press New folder on Library tab - add C:\Program Files\QGIS Valmiera\apps\qgis\python - to enable pyrcc4 and pyuic4 I've set Windows system variables - PYTHONHOME = C:\Program Files\QGIS Valmiera\apps\Python27 - PYTHONPATH = C:\Program Files\QGIS Valmiera\apps\Python27\Lib Any suggestion?... Best regards Franz ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Debugging Python plugin with Eclipse: breakpoints do not wotk
On Tue, Mar 25, 2014 at 9:39 AM, Francesco Sozzi fso...@intercad.ch wrote: Hi Everybody, I'm new on QGis developing and Python and I'm trying to setup a developing environment for building plugins on QGis. My problem is that breakpoints on Eclipse do not work, process does not stop on them. [...] Any suggestion?... Best regards Incredible, I am trying to do it in this moment, and I have the same problem. I need help, too :-) ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Debugging Python plugin with Eclipse: breakpoints do not wotk
I've also taken a try with an alternate RemoteDebug plugin (https://github.com/luipir/qgis-remote-debug) but with no luck. It's strange... RemoteDebug is not in the list of installable plugins and you have to manually download and install it. But on downloaded version, inside metadata.txt, I find qgisMaximumVersion=2.99; so I guess that it should be compatible. -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Debugging-Python-plugin-with-Eclipse-breakpoints-do-not-wotk-tp5130877p5130945.html Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Debugging Python plugin with Eclipse: breakpoints do not wotk
I usually do it without using the QGIS remote debugger. http://pydev.org/manual_adv_remote_debugger.html giovanni Il 25/mar/2014 14:02 Luca Manganelli luc...@gmail.com ha scritto: On Tue, Mar 25, 2014 at 9:39 AM, Francesco Sozzi fso...@intercad.chwrote: Hi Everybody, I'm new on QGis developing and Python and I'm trying to setup a developing environment for building plugins on QGis. My problem is that breakpoints on Eclipse do not work, process does not stop on them. [...] Any suggestion?... Best regards Incredible, I am trying to do it in this moment, and I have the same problem. I need help, too :-) ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Debugging Python plugin with Eclipse: breakpoints do not wotk
giohappy wrote I usually do it without using the QGIS remote debugger. http://pydev.org/manual_adv_remote_debugger.html giovanni Hi Giovanni, Many thanks for help, it works :) But... it seems that, with this approach, dynamic breakpoints are replaced by static calls of pydevd.settrace() written into code. I'm right?... This can be good for simple scenario, but with complex code it could be tricky to statically write pydevd.settrace() wherever you suppose to need a break. So... that's a very good starting point for me, but I still need to fix RemoteDebug (and use breakpoints) for developing scenario I would like to open in the future. Best regards Francesco -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Debugging-Python-plugin-with-Eclipse-breakpoints-do-not-wotk-tp5130877p5130963.html Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Debugging Python plugin with Eclipse: breakpoints do not wotk
just a note... there's no alternative RemoteDebug plugin... my changes where merged in the main project https://github.com/sourcepole/qgis-remote-debug In my case it works... now I can't rememnber If I set something particular (and I've no time to check now)... what I can say is that remote debug plugin connect pydev server only if it is strictly clearly started... otherwise sometimes it does nothing. so my procedure is... running pydev debug server... then start qgis... then start remotedebug plugin then I start to debug see you Luigi Pirelli On 25 March 2014 14:34, Franz1965 fso...@intercad.ch wrote: I've also taken a try with an alternate RemoteDebug plugin (https://github.com/luipir/qgis-remote-debug) but with no luck. It's strange... RemoteDebug is not in the list of installable plugins and you have to manually download and install it. But on downloaded version, inside metadata.txt, I find qgisMaximumVersion=2.99; so I guess that it should be compatible. -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Debugging-Python-plugin-with-Eclipse-breakpoints-do-not-wotk-tp5130877p5130945.html Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer