Set Breakpoint / Debug module outside of current project

Hello -

I'm debugging some code that makes use of an API wrapper that somebody wrote that is not part of the package that I'm actually debugging (It's in an entirely different parent directory) and I want to be able to put a breakpoint on / debug this 'external package' so that I can inspect the variables in memory at run time.

To Clarify:  Pycharm highlights the import statement for the API wrapper as invalid because it is not part of the project.  However, the code will still run because the path to the API wrapper has been added to the PYTHONPATH environment variable on the Operating system.  All of this was put together by another person a long time ago, is 'productionalized' and is not under and sort of VC, so I need to tread very lightly as far as suggestions to 'just don't do it that way' might go.

With this in mind, is there a way that I can put a breakpoint in the package 'referred to' by the package I'm debugging, then run the code from the main 'referring' program and debug?

1 comment
Comment actions Permalink

Hi,
Have you tried setting a breakpoint in a module of that external package?
You can just drag'n'drop the file to PyCharm, set a breakpoint, and debug your main package. It should hit that breakpoint when reached.

0

Please sign in to leave a comment.