I have the following python package structure
configuration /
__init__.py
scripts /
__init__.py
packageA /
__init__.py
my_file_1.py
packageB /
__init__.py
my_file_2.py
In the file my_file_1.py, I have an import statement which imports a class from my_file_2.
The import statement looks like:
from configuration.scripts.packageB.my_file_2 import myClassA
Now when I run my program (my_file_1.py) I always get this error that
ImportError: No module named configuration.scripts.packageB.my_file_2
To run the program. I am running the following command:
python my_file_1.py
I can't figure out what I am doing wrong since I have init.py files in my package structure as well. I tried using sys.path.append, but that messes up things when I write python unit tests. Can somebody help me figure what's going wrong?