I'm trying to create my first package using the format from the python tutorial and am getting ModuleNotFoundError when trying to run unittests from the tests subfolder in PyCharm, but can run the same test fine through IDLE.
As per the tutorial this is the general folder structure
packaging_tutorial
── LICENSE
── README.md
── example_pkg
└── __init__.py
── setup.py
── tests
└── example_test.py
Initially I couldn't get the test to run at all on either IDLE or PyCharm. After using pip to install the package through Command Prompt I've been able to run the tests through IDLE. However when trying to run them in PyCharm, I'm getting ModuleNotFound.
I've tried using the suggestions from this previous question of Invalidate Cache/Restart, I've checked Project Interpreter & the confirmed the package is listed, I've tried doing pip install of the package in the PyCharm terminal.
I'd imagine this is a relatively straightforward fix. This is my first project using PyCharm, and I'm guessing there was/is some preliminary stuff that I could/should have done that would avoid this issue.