IMAGE-Generalized File Tree
Okay everyone, I have tried all the answers on here. Above is the generalized version of my file structure. In my file Aa_func.py I want to import everything in project_imports.py. In other words I would like to run
from top.imports.project_imports import *
Here is everything I have tried:
- Put an
__init__.py
file in top and then tryfrom top.imports.project_imports import *
- Tried using relative importing
from ..imports.project_imports import *
- I tried putting an import statement in
__init__.py
for the A directory. Then importing using relative import again in Aa. I saw this done in a 3rd party package I routinely work with.
I either get the error about no parent package detected or no module found.
Any help would be appreciated. I feel like this should be so simple yet here I am. I would think that the import path would always start from top and search from there but I guess not.