I have a project dir set up as following:
In web app I have some relative imports from data_api.py e.g.
from .data_api import func1, func2
This runs fine from the project dir using(no explicit PYTHONPATH set):
python -m package.webapp
However, if I run or debug webapp from pycharm I get:
ModuleNotFoundError: No module named '__main__.data_api'; '__main__' is not a package
This happens even if I mark package as the 'Sources Root' and add both the sources and content root to the PYTHONPATH in the run config.
This post seemed to suggest that would work:
But presently I can't get debug/run mode to work within pycharm.