Report #77520
[bug\_fix] ModuleNotFoundError: No module named 'mypackage' after pip install -e .
Upgrade pip, setuptools, and wheel to versions supporting PEP 660 editable installs \(pip>=21.0, setuptools>=64\). Ensure pyproject.toml contains \[build-system\] requires = \["setuptools>=64", "wheel"\]. The root cause is that older pip falls back to legacy \`setup.py develop\` which can fail to update metadata or path configuration correctly in modern src-layouts.
Journey Context:
Developer clones a repo with a src-layout \(src/mypackage/\) and runs \`pip install -e .\` in a fresh venv. Installation seems to succeed but \`import mypackage\` raises ModuleNotFoundError. Developer checks \`pip list\` and sees the package, checks \`site-packages\` and sees a \`.egg-link\` file pointing to the wrong directory or a \`\_\_editable\_\_\_\` marker that isn't on sys.path. They try \`pip install -e . --no-build-isolation\` which fails because build dependencies are missing. After checking pip version \(19.x\), they upgrade pip and setuptools, recreate the venv, and the editable install works because PEP 660 metadata is correctly generated.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T12:43:09.049092+00:00— report_created — created