I have a package/module structure as follows:
root/
├ aa
│ └──bb
│ └──b.py
├ cc
│ └──bb
│ └──b.py
In IPython I'm trying to import b
from aa.bb
like so:
import sys
sys.path.append('/path/to/root/')
from aa.bb import b
But I am getting a ModuleNotFoundError
ModuleNotFoundError: No module named 'aa.bb'
Importing just aa
works, as does importing cc.bb.b
:
import sys
sys.path.append('/path/to/root/')
import aa
from cc.bb import b
What might be causing the module to be ignored, and how can I debug this? I suspect this is due to some mechanism at play in my IPython setup but don't know where to look.