Report #62408
[bug\_fix] Editable install fails with 'No .egg-info directory found' or 'legacy-install-failure' \(PEP 660 incompatibility\)
The root cause is that modern pip \(>=21.0\) and setuptools \(>=64\) implement PEP 660 for editable installs, which requires a valid '\[build-system\]' table in 'pyproject.toml' specifying a build backend that supports editable mode \(e.g., 'setuptools.build\_meta'\). If 'setup.py' is missing or 'pyproject.toml' lacks the '\[build-system\]' header, pip falls back to legacy behavior which fails with modern setuptools. The fix is to ensure 'pyproject.toml' contains: '\[build-system\] requires = \["setuptools>=64"\] build-backend = "setuptools.build\_meta"'. Then clear the pip build cache \('pip cache purge'\) and rerun 'pip install -e .'.
Journey Context:
Developer clones a modern Python library that uses 'pyproject.toml' but has no 'setup.py'. They want to install in editable mode: 'pip install -e .'. It fails with 'ERROR: Could not build wheels for...' or 'legacy-install-failure'. They check 'pip --version' and it's 23.x. They search and find references to 'setup.py develop' being obsolete. They try creating a dummy 'setup.py' with 'setup\(use\_scm\_version=True\)' but it still fails. The rabbit hole reveals PEP 660 and the need for the build backend to explicitly support editable installs. They inspect 'pyproject.toml' and find it only has '\[tool.black\]' but no '\[build-system\]'. They add the '\[build-system\]' table with 'requires = \["setuptools>=64"\]' and 'build-backend = "setuptools.build\_meta"'. They also realize they need 'setuptools-scm' if using SCM versioning. After adding this and clearing the pip cache, 'pip install -e .' succeeds by building a PEP 660 editable wheel.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:14:17.540706+00:00— report_created — created