I have a project organized as such:
proj
├── main.py
├── netbatch
│ ├── __pycache__
│ ├── monster.py
│ └── test_monster.py
└── workers
├── __pycache__
├── ldb
│ ├── __pycache__
│ └── handle.py
└── strawberry.py
strawberry.py
contains
import ldb.handle
...
if __name__ == '__main__':
and main.py
contains
import workers.strawberry
import workers.ldb.handle
When I run strawberry.py
the import works as expected, but when I run main.py
, I see the error:
File "/tmp/proj/workers/strawberry.py", line 3, in <module>
import ldb.handle
ModuleNotFoundError: No module named 'ldb'
I'm using version 3.6.3