Report #38873
[bug\_fix] pip install -e . fails with 'Directory has pyproject.toml' or editable metadata error, or ModuleNotFoundError after install
Upgrade the packaging toolchain to support PEP 660 \(modern editable installs\): \`pip install --upgrade pip setuptools wheel\` \(ensure \`pip>=21.3\`, \`setuptools>=64\`\). These versions recognize the editable hook in \`pyproject.toml\` \(e.g., \`setuptools.build\_meta\`\) and correctly create \`.pth\` files or symlinks without requiring \`setup.py\`.
Journey Context:
A developer clones a modern library using \`pyproject.toml\` \(no \`setup.py\`\) and \`setuptools\` as the build backend. Their environment has \`pip==20.2\` and \`setuptools==44\` \(pre-PEP 660\). They run \`pip install -e .\`. Pip looks for \`setup.py\` for legacy editable install, doesn't find it, and fails with \`Directory has 'pyproject.toml' but no 'setup.py'\`. If they upgrade pip but not setuptools, they might get \`Preparing editable metadata ... error\` because the backend doesn't implement \`get\_requires\_for\_build\_editable\`. If they bypass with \`--no-build-isolation\`, they get \`ModuleNotFoundError\` because the editable path wasn't registered correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:43:25.748303+00:00— report_created — created