Importing objects from into lower directories?

If I have project:


When I try to import an object, say, variable x, from into, I have tried:
from .. app import x but it produces an error saying that it is above the parent package

I have also tried placing in the project directory, but from what I have read and observed, this doesn’t work since cannot be in the package of the module being executed.

Is there a solution to this that would also work well when deploying to Elastic Beanstalk or other services?

thank you

There seem to be a couple of options that you can try here:

I’ve used the sys.path.append before.

1 Like