atom-python-debugger
atom-python-debugger copied to clipboard
Debugger cannot import custom packages from directory other than that of main file
It appears that python-debugger cannot be used to debug custom packages; steps to reproduce:
- Set up the following directory structure, e.g., in /tmp/example:
├── maindir │ └── main.py └── mypackage └── __init__.py - contents of
main.py
import os
print(os.listdir())
import mypackage # or similarly from . import mypackage
- contents of
__init__.py
print("This worked!")
- Open main.py in atom
- Launch a debugger with the following options:
- Program:
/tmp/example/maindir/main.py - Python Path:
/usr/local/bin/python3 - Cwd:
/tmp/example - Automatically Stop after launch
- Program:
- Hit F8 to start
- Now for some reason I need to type something into the debugger's console and execute it to get the debugger running this may be an issue of itself!
- executing the second line of
main.pyconfirms that I am in/tmp/example/yet executing the third one fails withTraceback (most recent call last): Python Debugger 4:07:41 PM File "/tmp/example/maindir/main.py", line 3, in <module> Python Debugger 4:07:41 PM import mypackage Python Debugger 4:07:41 PM ModuleNotFoundError: No module named 'mypackage' - when moving
main.pyto Cwx (/tmp/example) the import works!