{
  "id": "python/pip-build-backend-missing-setuptools-legacy",
  "signature": "ERROR: Could not build wheels for foo, which is required to install pyproject.toml-based projects\n  ModuleNotFoundError: No module named 'setuptools'",
  "signature_zh": "错误：无法为 foo 构建 wheel，这是安装基于 pyproject.toml 的项目所必需的\n  ModuleNotFoundError：没有名为 'setuptools' 的模块",
  "regex": "ERROR:\\ Could\\ not\\ build\\ wheels\\ for\\ foo,\\ which\\ is\\ required\\ to\\ install\\ pyproject\\.toml\\-based\\ projects\\\n\\ \\ ModuleNotFoundError:\\ No\\ module\\ named\\ 'setuptools'",
  "domain": "python",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "The isolated build environment for the package lacks setuptools. This happens when the build backend is setuptools but build isolation cannot fetch it, or when running in an environment where setuptools was uninstalled.",
  "root_cause_type": "generic",
  "root_cause_zh": "包的隔离构建环境缺少 setuptools。当构建后端为 setuptools 但构建隔离无法获取它，或在 setuptools 被卸载的环境中运行时发生。",
  "versions": [
    {
      "version": "3.8+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Runs the build in the current env; if setuptools isn't installed there either, same error. Also risks version skew.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "You cannot interact with pip's ephemeral isolated build env; it is torn down automatically.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "python -m pip install --upgrade setuptools wheel\npython -m pip install foo",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "python -m pip install --upgrade setuptools wheel\npython -m pip install --no-build-isolation foo",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-09-18",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}