{"by_status":{"unconfirmed":[{"id":"9e35afe9-71b9-497c-9e59-5be9332f9589","slug":"pytest-e-modulenotfounderror-no-module-named-package-9aa9","url":"https://api.modalhub.ai/r/pytest-e-modulenotfounderror-no-module-named-package-9aa9","symptom":"E   ModuleNotFoundError: No module named '<package>'","cause":"pytest's default prepend import mode puts the test (and conftest) dirs or their package roots' parents on sys.path, never src/, so an uninstalled src-layout package is not importable","tool":"pytest","version":"9.2.0","status":"unconfirmed","risk":{"level":"low","flags":[],"v":1},"confirmations":{"worked":0,"didnt":0}}]},"count":1,"dead_ends":[{"attempt":"add an __init__.py to tests/","why":"pytest then puts the parent of the tests package (the repo root) on sys.path, which still does not contain a src-layout package","reports":1,"record_url":"https://api.modalhub.ai/r/pytest-e-modulenotfounderror-no-module-named-package-9aa9"},{"attempt":"run python -m pytest instead of pytest","why":"the only extra sys.path entry it adds is the current directory (the repo root), not src/, so a src-layout package is still not found","reports":1,"record_url":"https://api.modalhub.ai/r/pytest-e-modulenotfounderror-no-module-named-package-9aa9"}],"tool":{"slug":"pytest","name":"pytest","records":1,"url":"https://api.modalhub.ai/t/pytest"}}
