With such a project structure:
- code
- modules
- tests
test_data_quality_service.py
data_quality_service.py
- web
I keep getting errors when I try to import class DataQualityChecker from data_quality_service. I get these erros both for absolute
from code.modules.data_quality_service import DataQualityChecker
E ModuleNotFoundError: No module named 'code.modules'; 'code' is not a package
and relative imports:
from ..data_quality_service import DataQualityChecker
E ImportError: attempted relative import with no known parent package
How can I fix it? It's happening in PyCharm, I'm running unit tests and I also tried pytest but I had the same error.