{
  "id": "python/pip-build-backend-not-found",
  "signature": "ERROR: Could not build wheels for foo, which is required to install pyproject.toml-based projects\n\n× Preparing metadata (pyproject.toml) did not run successfully.\n╰─> BackendUnavailable: Cannot import 'setuptools.build_meta'",
  "signature_zh": "错误：无法为 foo 构建 wheel，这是安装基于 pyproject.toml 的项目所必需的\n\n× 准备元数据（pyproject.toml）未能成功运行。\n╰─> BackendUnavailable: 无法导入 'setuptools.build_meta'",
  "regex": "ERROR:\\ Could\\ not\\ build\\ wheels\\ for\\ foo,\\ which\\ is\\ required\\ to\\ install\\ pyproject\\.toml\\-based\\ projects\\\n\\\n×\\ Preparing\\ metadata\\ \\(pyproject\\.toml\\)\\ did\\ not\\ run\\ successfully\\.\\\n╰─>\\ BackendUnavailable:\\ Cannot\\ import\\ 'setuptools\\.build_meta'",
  "domain": "python",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "The build backend declared in pyproject.toml [build-system].build-backend cannot be imported inside the isolated build environment, usually because the backend package is not listed in [build-system].requires.",
  "root_cause_type": "generic",
  "root_cause_zh": "pyproject.toml [build-system].build-backend 中声明的构建后端无法在隔离的构建环境中导入，通常是因为后端包未列入 [build-system].requires。",
  "versions": [
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Without isolation, the backend must already be installed in your env; if it is not, the same error occurs.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "pip version does not affect whether the build backend is importable.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Add the backend to requires in pyproject.toml:\n  [build-system]\n  requires = [\"setuptools>=61\", \"wheel\"]\n  build-backend = \"setuptools.build_meta\"\nFor hatchling: requires = [\"hatchling\"], build-backend = \"hatchling.build\"",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "If you only consume the package, install the backend manually then build without isolation:\n  pip install setuptools wheel\n  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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}