Report #52327
[bug\_fix] PEP 517 build isolation fails with ModuleNotFoundError for setuptools/poetry during pip install
Add a \`\[build-system\]\` section to \`pyproject.toml\` declaring the build dependencies \(e.g., \`requires = \["setuptools>=45", "wheel"\]\`\), or disable build isolation with \`pip install --no-build-isolation .\` after manually installing build deps in the environment.
Journey Context:
Developer clones a legacy project with only \`setup.py\` and no \`pyproject.toml\`. In a fresh venv with pip 23\+, they run \`pip install .\`. The build fails with \`ModuleNotFoundError: No module named 'setuptools'\`. Developer checks \`pip list\` and sees \`setuptools\` is installed globally in the venv, confused. They learn that pip uses PEP 517 build isolation by default: it creates a temporary isolated environment with only the build dependencies specified in \`pyproject.toml\`. Since there is no \`pyproject.toml\`, pip assumes legacy setuptools but the isolated env doesn't have it. Developer adds \`pyproject.toml\` with \`\[build-system\] requires = \["setuptools>=45", "wheel"\]\` and \`build-backend = "setuptools.build\_meta"\`, and the install succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:19:24.494704+00:00— report_created — created