I installed a Python package and would like to debug it using PyCharm. Typically I can simply set breakpoints and debugging works fine. However, the package (let's call it module_name) I am using now has to be called from the terminal, or in a Python script using os.system
("module_name --additional_args"). It runs fine like this, but if I put a breakpoint in module_name.py at entry_func()
:
def get_parser():
...
def entry_func(args=None):
...
if __name__ == "__main__":
entry_func()
The breakpoint is ignored. Why is that? And how can I debug this module otherwise?
I tried to set a breakpoint at entry_func()
, but the program did not stop there.