5

As the title of the question implies, I wish to know how to set up a QGIS Python Plugin Debugger so that I can develop plugins more efficiently.

Any information regarding this would be much appreciated as I am fairly new to QGIS Python Plugin Development.

3
  • which OS are you using?
    – Ian Turton
    Jun 4, 2013 at 9:25
  • @iant based on his previous question, I think he is free to chose any: gis.stackexchange.com/questions/62553/…
    – underdark
    Jun 4, 2013 at 11:28
  • Apologies for the late reply @iant I am currently using Windows but if need be I will use an alternative environment. Jun 4, 2013 at 12:42

4 Answers 4

1

Plugins are written in Python, so use a Python debugger as pdb present in the standard distribution

enter image description here

and look Python module of the week: pdb – Interactive Debugger, Debugging in Python or the multiple tutorials on the Web.

Or choose another one of those presented in Python Debugging Tools

1
  • You can't drop into pdb while running the plugin, though... May 28, 2019 at 13:52
1

If you want to have a step-by-step debugger, you can use the RemoteDebug plugin which integrates nicely with PyDev and Eric. But success has been reported with other environments as well.

This recent StackExchange question concerning code completion may be interesting as well.

0
1

See this: http://linfiniti.com/2011/12/remote-debugging-qgis-python-plugins-with-pydev/ and this: http://linfiniti.com/2012/09/remote-debugging-qgis-plugins-using-pycharm/ for information on debugging with PyDev and PyCharm respectively.

1
  • 2
    Both those links are dead, which is why links are not preferred on StackExchange sites. If you can find them again, better would be to copy/paste/redo-the-steps for reference here, and have the links as an aside May 28, 2019 at 13:51
1

The links posted by gsherman are available on the wayback machine for anyone (like me) trying to solve the same problem: https://web.archive.org/web/20160315041546/http://linfiniti.com/2011/12/remote-debugging-qgis-python-plugins-with-pydev/ They are blog posts with lots of pictures, so I won't copy/paste them here.

3
  • is this an actual way of working with QGIS plugins even now in 2023?
    – sys49152
    Mar 7, 2023 at 8:59
  • I'm trying it now, will return if I figure it out!
    – fhansen
    Mar 7, 2023 at 12:04
  • 1
    Seems to work perfectly! Now, if only I could say the same about my plugin...
    – fhansen
    Mar 7, 2023 at 12:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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