I have an application at work that is set up with the following structure.
/project_root
/applications
/app1
__init__.py
/app2
The solution to this was a two step process:
pkg
directory as a source root. Do this by selecting File
-> Settings
-> Project
-> (select the project) -> Project Structure
then select the pkg
directory and add by clicking the Sources
button. Click Ok.File
-> Invalidate Caches / Restart
-> Invalidate and Restart
Wait for PyCharm to restart and rebuild it's cache / scan the indexes. Now the pkg
directory is detected as a source root and my errors are gone.