I need to run my program as python3 -m directory.__init__
, but trace does not allow to do so. It forces me to run it like python3 directory/__init__.py
I am running trace like python3 -u -m trace -t directory/__init__.py
(How to debug python script that is crashing python) but trace is not running my script as a module:
from . import mymodule
ImportError: cannot import name 'mymodule'
Then, all my relative imports (as from . import mymodule
) are failing.
The same problem was recently fixed in Python 3.7, but for the pdb
module: How to debug a Python module run with python -m from the command line?, now I can run pdb
like
python3 -m pdb -m directory.__init__