{
  "id": "python/pip-wheel-not-supported-platform",
  "signature": "ERROR: Could not build wheels for somepkg, which is required to install pyproject.toml-based projects\n  error: subprocess-exited-with-error\n  × Building wheel for somepkg (pyproject.toml) did not run successfully.\n  │ exit code: 1\n  ╰─> [12 lines of output]\n      gcc: error: unrecognized command-line option '-mavx2'",
  "signature_zh": "错误：无法为 somepkg 构建 wheel，这是安装基于 pyproject.toml 的项目所必需的\n  错误：子进程退出并报错\n  × 为 somepkg（pyproject.toml）构建 wheel 未成功运行。\n  │ 退出码：1\n  ╰─> [12 行输出]\n      gcc: 错误：无法识别的命令行选项 '-mavx2'",
  "regex": "ERROR:\\ Could\\ not\\ build\\ wheels\\ for\\ somepkg,\\ which\\ is\\ required\\ to\\ install\\ pyproject\\.toml\\-based\\ projects\\\n\\ \\ error:\\ subprocess\\-exited\\-with\\-error\\\n\\ \\ ×\\ Building\\ wheel\\ for\\ somepkg\\ \\(pyproject\\.toml\\)\\ did\\ not\\ run\\ successfully\\.\\\n\\ \\ │\\ exit\\ code:\\ 1\\\n\\ \\ ╰─>\\ \\[12\\ lines\\ of\\ output\\]\\\n\\ \\ \\ \\ \\ \\ gcc:\\ error:\\ unrecognized\\ command\\-line\\ option\\ '\\-mavx2'",
  "domain": "python",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "No prebuilt wheel exists for the target platform/Python combo, so pip falls back to building from source, and the local toolchain (gcc/clang) does not support the required flags or lacks headers.",
  "root_cause_type": "generic",
  "root_cause_zh": "目标平台/Python 组合没有预构建 wheel，pip 回退到从源码构建，而本地工具链（gcc/clang）不支持所需标志或缺少头文件。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Forces source builds for everything, making the failure more likely and slower.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Disables isolation but the compiler still lacks the required flags/headers.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The build failure is deterministic; retries produce the same compiler error.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Install build deps: apt-get install -y build-essential python3-dev (or xcode-select --install on macOS)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "Upgrade the compiler: on macOS 'brew install gcc' and set CC=gcc-13; on Linux use a newer distro or toolchain",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.75,
      "how": "Use a prebuilt manylinux wheel from a different index: pip install --only-binary=:all: --extra-index-url https://download.pytorch.org/whl/cpu somepkg",
      "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.83,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2024-10-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}