Report #16675
[bug\_fix] pip install -e . fails with 'No module named setuptools' or 'Backend not available' despite setuptools being installed globally
Add a \`pyproject.toml\` file at the project root declaring the build-system requirements: \`\[build-system\] requires = \["setuptools>=45", "wheel"\] build-backend = "setuptools.build\_meta"\`.
Journey Context:
Developer clones a legacy project containing only \`setup.py\` and no \`pyproject.toml\`. In a fresh virtual environment, they run \`pip install -e .\` to install in editable mode. Since pip 21.0\+, pip implements PEP 660 \(editable installs via build hooks\) and uses build isolation by default. It creates an isolated environment to build the wheel, which does not have access to the globally \(or even virtually\) installed \`setuptools\` unless declared. The build fails with \`ModuleNotFoundError: No module named 'setuptools'\` or \`Backend 'setuptools.build\_meta' is not available\`. The developer tries \`pip install setuptools wheel\` first, but the error persists because the build isolation is separate. The correct fix is to declare \`\[build-system\]\` in \`pyproject.toml\` so pip installs \`setuptools\` into the isolated build environment before attempting the editable install.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T03:17:50.245719+00:00— report_created — created