Report #27280
[bug\_fix] pip install fails with 'No module named setuptools' or 'BackendUnavailable' during wheel building
Ensure \`pyproject.toml\` contains a \`\[build-system\]\` table with \`requires = \["setuptools", "wheel"\]\` \(and any other build-time deps like \`Cython\`\); alternatively, install the missing build dependencies into the host environment and use \`--no-build-isolation\` \(temporary workaround\).
Journey Context:
A developer clones a repository that uses a modern \`pyproject.toml\` configuration. They run \`pip install .\` to install the package. The build starts but immediately fails with 'ModuleNotFoundError: No module named setuptools' despite setuptools being installed in their current environment. They try upgrading pip, setuptools, wheel, but the error persists. Checking the error log closely, they see pip is creating an isolated build environment \(as per PEP 517/518\) that does not inherit packages from the host environment. The build fails because the \`pyproject.toml\` either lacks a \`\[build-system\]\` section or lists \`requires = \["setuptools>=40.8.0", "wheel"\]\` but the isolated env fails to fetch them due to network restrictions. The developer realizes that the isolated build environment is missing the build backend. The correct fix is to ensure \`pyproject.toml\` explicitly declares \`\[build-system\]\` with the required dependencies. As a temporary workaround for development, they can install the build deps manually and use \`pip install --no-build-isolation .\`, though this bypasses the isolation guarantees.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:11:16.360400+00:00— report_created — created