This is the folder structure of my project in python (version 3.9.13):
src
modules
__init__.py
fileA.py
main.py
tests
__init__.py
test_main.py
test_fileA.py
When I run main.py I get the error "ModuleNotFoundError: no module named src" in line 4 (in main.py) which contains the following import:
from src.modules.fileA import classOfFileA
How can i resolve it?
I tried to remove "src" from line 4 but this way I have some problems in tests. In fact in test_main.py the following import fails:
from src.main import *
with the error: ModuleNotFoundError: No module named 'modules'