{
  "id": "python/setuptools-missing-build-system-requires",
  "signature": "ERROR: Could not build wheels for mypkg, which is required to install pyproject.toml-based projects\n\n× Building wheel for mypkg (pyproject.toml) did not run successfully.\n│ exit code: 1\n╰─> ModuleNotFoundError: No module named 'setuptools'",
  "signature_zh": "错误：无法为 mypkg 构建 wheel，而这是安装基于 pyproject.toml 的项目所必需的\n\n× 为 mypkg 构建 wheel（pyproject.toml）未能成功运行。\n│ 退出代码：1\n╰─> ModuleNotFoundError: 没有名为 'setuptools' 的模块",
  "regex": "ERROR:\\ Could\\ not\\ build\\ wheels\\ for\\ mypkg,\\ which\\ is\\ required\\ to\\ install\\ pyproject\\.toml\\-based\\ projects\\\n\\\n×\\ Building\\ wheel\\ for\\ mypkg\\ \\(pyproject\\.toml\\)\\ did\\ not\\ run\\ successfully\\.\\\n│\\ exit\\ code:\\ 1\\\n╰─>\\ ModuleNotFoundError:\\ No\\ module\\ named\\ 'setuptools'",
  "domain": "python",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "The project's pyproject.toml declares a [build-system] table whose 'requires' omits setuptools (or declares an empty list), so the isolated build env lacks the backend.",
  "root_cause_type": "generic",
  "root_cause_zh": "项目的 pyproject.toml 声明了 [build-system] 表，但其 'requires' 中缺少 setuptools（或声明为空列表），因此隔离的构建环境缺少该后端。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Build isolation creates a fresh env; the current venv's setuptools is not visible.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Then the build uses the current Python's setuptools, which may be absent or too old.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.97,
      "how": "[build-system]\nrequires = [\"setuptools>=68\", \"wheel\"]\nbuild-backend = \"setuptools.build_meta\"",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "python -m pip install 'setuptools>=68' wheel\npython -m pip install --no-build-isolation mypkg",
      "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-03-28",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}