I know there are many similar questions out there already, but none of the answers did really work for me, so please read my question first (and tell me where I went wrong with the other solutions) before marking this as duplicate.
My project structure looks like this:
Project/
|-- src/
|-- project/
|-- a.py
|-- b.py
|-- tests/
|--c.py
I don't know much about how to strucure python projects/how packages etc. work exactly.
I want to import a
in my c
module.
I tried things like
from project.a import xyz
from ..a import xyz
I also added __init__.py
files to both the project
and the tests
directory.
But still I always get ModuleNotFoundError: No module named 'project'
Then I tried adding the project
path to my sys.path
before importing a
, but still I get the same error message.
What am I doing wrong?