Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14011

ModuleNotFoundError: Python files seem to behave differentely inside and outside of Pycharm

$
0
0

Some months ago, I developed a project using PyCharm and it worked just fine. Now if I want to enter the venv venv\Scripts\activate and start the project from cmd python src\main.py, I receive ModuleNotFoundError No module named 'src' when main.py and other files try to import stuff from src.

When I move all my files from src to the project root folder, it straightens out. A lot has happened with this project and my Python environment, but that's frankly besides the point.

Why does main.py"see" the project from the root in PyCharm, but now in command line it doesn't? And how can I deal with it?


Viewing all articles
Browse latest Browse all 14011

Trending Articles