pdb: set a breakpoint on file which isn't in sys.path

According to this answer you can also set a break point by writing the full path to filename (or path relative to directory on sys.path)

For example

b /path/to/module.py:34
> Breakpoint 1 at /path/to/module.py:34

You have to load your module in order to use it (debug it in your case). Python looks at sys.path variable to load it's modules.

From the docs,

sys.path: A list of strings that specifies the search path for modules. Initialized from the environment variable PYTHONPATH, plus an installation-dependent default.

It is initialized from the PYTHONPATH environment variable; so you can add your path to this env variable instead of your module.

Or you can add the sys.path.append(os.path.join(os.getcwd(),"project_cameo")) line to your module at the top.

Tags:

Python

Pdb