Inconsistent Python import behaviour with subdirectories
When splitting my python code into simple modules and putting them in a subdirectory, I see seemingly inconsistent behaviour that I was not able to solve by adding an __init__.py
file in the module. I am also unable to understand why things not seem to work consistently. Please explain or point to documentation where this “logic” is explained:
Import files from external submodule
Is it possible to execute an external submodule of a project without changing the file content of the submodule itself?
Suppose I have this hierarchy.
Chaining sibling directory imports in Python 3.8+
In my Python project, I am having trouble with sibling directory imports. My file structure is as follows: