1

Here is the current directory setup:

dir_a:
  __init__.py
  one.py
  two.py

Here is one.py:

from dir_a.two import TwoClass

From inside dir_a, running

"python -m pdb one.py" 
"ModuleNotFoundError: No module named 'dir_a'"

From inside pdb, I've tried appending the absolute path to dir_a, but still having trouble finding and being able to import my Two class.

Parity Bit
  • 113
  • 1
  • 12
  • 2
    Possible duplicate of [Python pdb on python script run as package](https://stackoverflow.com/questions/36227688/python-pdb-on-python-script-run-as-package) – MisterMiyagi Jun 16 '19 at 04:51

1 Answers1

1

Two options:

  1. From directory containing dir_a: export PYTHONPATH="${PYTHONPATH}:$(pwd)"
  2. In pdb: import sys; sys.path.append('[dir containing dir_a]')

Don't add the dir_a path itself.

Parity Bit
  • 113
  • 1
  • 12