My question might have discussed in earlier posts too, but couldn't get proper answer applicable for my scenario. Hence posting it as a new query. I have multiple sub-folders where module tries to import modules present across multiple subfolders.
Folder Structure:
main
|-- lib
| |-- lib1.py
| |-- lib2.py
| `-- lib3.py
|-- common
| |-- lib4.py
|-- tests
| |--folder1
| |-- script1.py
| |-- folder2
| |-- script2.py
| |--scriptA.py
| `--scriptB.py
Use case/Requirements:
- script1 & script2 import functions from module lib1.py.
- lib1 wants to import functions from lib2.py & lib3.py
- lib4.py import funtions from lib1 & lib2
I tried adding blank __init__.py
in root folder (main) and the all other subfolders. But couldn't get this working. Ending up with 'ModuleNotFound' error.