Open mlangiu opened 3 years ago
├── maindir │ └── main.py └── mypackage └── __init__.py
main.py
import os print(os.listdir()) import mypackage # or similarly from . import mypackage
__init__.py
print("This worked!")
/tmp/example/maindir/main.py
/usr/local/bin/python3
/tmp/example
/tmp/example/
Traceback (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'
It appears that python-debugger cannot be used to debug custom packages; steps to reproduce:
main.py
__init__.py
/tmp/example/maindir/main.py
/usr/local/bin/python3
/tmp/example
main.py
confirms that I am in/tmp/example/
yet executing the third one fails withmain.py
to Cwx (/tmp/example
) the import works!