not sure how python is finding my imports and why it can't find others.
I have a folder structure as such:
top/[oreo]
middle/[oreo_models]
__init__.py
bottom1/[generic]
__init__.py
file1.py
bottom2/
__init__.py
file2.py
When I run python3, top/
is in sys.path
. In the interpreter, I'm able to run import middle
and see middle.__file__ == top/middle/__init__.py
. However, I get a ModuleNotFoundError: No module named bottom1 when I try import bottom1
, even though it should be a package findable from top! I tried removing middle/__init__.py
as well, but the same error persists.
What's going on? I'm using python 3.8.10