I have a pip packages project with the following folder structure:
/mypackage
/src
/mypackage
__init__.py
...
/tests
__init__.py
test_numer1.py
test_numer2.py
...
if I try to run my unittests with pycharm everything works just fine, all test get detected and no problem with imports. But if I try to run the unittest over the console via
python3 -m unittest
I get the error module named mypackage not found everywhere where I try to do from my package import .... I've tried to add/remove an __init__.py at all possible folders but it is still not working. I've also tried to move the tests folder in the /src folder, also not working. I've also tried to run the command from basically all possible folder positions still same error.
The pip package itself is working. In another project I can do
pip install mypackage
and then also use from mypackage import ...
Is there something wrong in general with my project structure?