{
  "id": "python/setuptools-native-ext-build-failure",
  "signature": "error: command 'gcc' failed: No such file or directory\n\n× Building wheel for lxml (pyproject.toml) did not run successfully.\n│ exit code: 1\n╰─> error: command 'gcc' failed with exit status 1",
  "signature_zh": "错误：命令 'gcc' 失败：没有那个文件或目录\n\n× 为 lxml 构建 wheel（pyproject.toml）未能成功运行。\n│ 退出代码：1\n╰─> 错误：命令 'gcc' 失败，退出状态 1",
  "regex": "error:\\ command\\ 'gcc'\\ failed:\\ No\\ such\\ file\\ or\\ directory\\\n\\\n×\\ Building\\ wheel\\ for\\ lxml\\ \\(pyproject\\.toml\\)\\ did\\ not\\ run\\ successfully\\.\\\n│\\ exit\\ code:\\ 1\\\n╰─>\\ error:\\ command\\ 'gcc'\\ failed\\ with\\ exit\\ status\\ 1",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "No C compiler (gcc/clang) is installed, so pip falls back to building a C extension from source and fails immediately.",
  "root_cause_type": "generic",
  "root_cause_zh": "未安装 C 编译器（gcc/clang），因此 pip 回退到从源码构建 C 扩展并立即失败。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Build tools are fine; the missing piece is the system C compiler.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Still attempts the source build and hits the same gcc error.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.92,
      "how": "# Debian/Ubuntu\nsudo apt install build-essential python3-dev libxml2-dev libxslt1-dev\n# macOS\nxcode-select --install\n# then\npython -m pip install lxml",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "python -m pip install --only-binary=:all: lxml\n# or pin a version that ships wheels for your platform\npython -m pip install 'lxml==5.2.2'",
      "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.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-08",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}