{
  "id": "python/pip-legacy-install-failure-use-pep517",
  "signature": "ERROR: Could not build wheels for foo, which is required to install pyproject.toml-based projects",
  "signature_zh": "错误：无法为 foo 构建 wheel，而它是安装基于 pyproject.toml 的项目所必需的",
  "regex": "ERROR:\\ Could\\ not\\ build\\ wheels\\ for\\ foo,\\ which\\ is\\ required\\ to\\ install\\ pyproject\\.toml\\-based\\ projects",
  "domain": "python",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "The package declares a pyproject.toml with a build backend (e.g. setuptools.build_meta, hatchling) but the required build dependencies are not installed or the build backend fails during the wheel step.",
  "root_cause_type": "generic",
  "root_cause_zh": "该包声明了带构建后端的 pyproject.toml（如 setuptools.build_meta、hatchling），但所需的构建依赖未安装，或构建后端在生成 wheel 阶段失败。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Disables isolation but if the build backend is missing from the current env, the build still fails — often with a more confusing error.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The wheel package is not the build backend here; installing it does not supply the missing build requirement.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Install build dependencies explicitly then retry: python -m pip install --upgrade pip setuptools wheel && python -m pip install foo",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Inspect the failing build: python -m pip install -v foo and look for the actual backend traceback. Then install the missing backend (e.g. python -m pip install hatchling or flit-core) and retry.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "Build in isolation with build: python -m pip install build && python -m build --wheel --no-isolation . to reproduce the backend error locally with full logs.",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-04-08",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}