0

IMAGE-Generalized File Tree

1

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:

  1. Put an __init__.py file in top and then try from top.imports.project_imports import *
  2. Tried using relative importing from ..imports.project_imports import *
  3. 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.

vimuth
  • 5,064
  • 33
  • 79
  • 116

0 Answers0