Report #85442
[bug\_fix] ModuleNotFoundError: No module named 'setuptools' \(during pip install\)
Use \`pip install --no-build-isolation .\` after installing build deps, or ensure \`pyproject.toml\` has \`\[build-system\]\` requires including setuptools and wheel. Root cause: PEP 517/518 isolated builds create a fresh environment without inheriting installed packages unless they are listed as build-system requires.
Journey Context:
Developer clones a package with \`pyproject.toml\` but no \`setup.py\`. Runs \`pip install .\` in a fresh venv. Gets error during metadata preparation: ModuleNotFoundError: No module named 'setuptools'. Confused because \`pip list\` shows setuptools 65.0. Realizing pip creates an isolated build environment per PEP 517 that doesn't inherit installed packages. The \`pyproject.toml\` exists but might be missing \`requires\` or lists only \`flit\_core\`. Solution is to add \`requires = \["setuptools>=45", "wheel"\]\` to pyproject.toml, or temporarily disable isolation with \`--no-build-isolation\` after manually installing build deps. Understanding that modern pip builds packages in isolation by default, unlike legacy \`python setup.py install\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:59:59.369439+00:00— report_created — created