I'm trying to run a python script on my Windows 10 Computer. The structure of the directory looks as follows
MyProject
- src
- main.py
__init__.py
- features
- featureExtraction.py
- __init__.py
The main folder is "MyProject". In "MyProject" is a subfolder called "src". In "src" the files "main.py" and "init.py" as well as the folder "features" exists. In the folder "features" there are the files "featureExtraction.py" and "init.py".
In "main.py" I have the following import:
import src.features.featureExtraction
When I run main.py within pycharm everything works, but when I start the script on the command line using "python main.py" (beeing in the src folder), then I'm getting an error:
ModuleNotFoundError: No module named 'src'".
Why does this happen?
import features.featureExtraction