# ModuleNotFoundError: No module named 'mypkg'  # after pip install -e . succeeded

- **ID:** `python/pip-editable-install-missing-pth`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Editable install created a __editable__*.pth file pointing at a path that no longer exists (moved project, renamed package dir), or the .pth was not picked up because site-packages is not on sys.path.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   python -m pip uninstall -y mypkg
cd /current/path/to/project
python -m pip install -e .
   ```
2. **** (88% success)
   ```
   python - <<'PY'
import site, pathlib
for sp in site.getsitepackages():
    for pth in pathlib.Path(sp).glob('__editable__*mypkg*.pth'):
        print(pth, '->', pth.read_text().strip())
PY
# then remove stale entries and reinstall
   ```

## Dead Ends

- **** — If the project was moved, pip regenerates the same stale path or a duplicate .pth. (70% fail)
- **** — Hardcodes a machine-specific path and does not fix the broken editable metadata. (75% fail)
