{
  "id": "python/pip-install-error-subprocess-exited-with-error",
  "signature": "error: subprocess-exited-with-error\n× python setup.py egg_info did not run successfully.\n│ exit code: 1\n╰─> [12 lines of output]",
  "signature_zh": "错误：子进程退出并报错\n× python setup.py egg_info 未能成功运行。\n│ 退出码：1",
  "regex": "error:\\ subprocess\\-exited\\-with\\-error\\\n×\\ python\\ setup\\.py\\ egg_info\\ did\\ not\\ run\\ successfully\\.\\\n│\\ exit\\ code:\\ 1\\\n╰─>\\ \\[12\\ lines\\ of\\ output\\]",
  "domain": "python",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "pip is trying to build a package from source using the legacy setup.py egg_info path, and the build script fails — usually missing system build dependencies (compilers, headers), a broken setup.py, or incompatible setuptools version.",
  "root_cause_type": "generic",
  "root_cause_zh": "pip 尝试通过旧的 setup.py egg_info 路径从源码构建包，构建脚本失败——通常是缺少系统构建依赖（编译器、头文件）、setup.py 损坏，或 setuptools 版本不兼容。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "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": "Cache is not the cause; the build subprocess still fails identically because the underlying compiler/header issue remains.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Upgrading build tools helps only if the failure is due to outdated setuptools; missing C headers or a broken setup.py still fails.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.82,
      "how": "pip install --only-binary=:all: <package>\n# or force a wheel for a specific platform\npip install <package> --only-binary=:all: --platform manylinux2014_x86_64 --python-version 311 --implementation cp --abi cp311",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.78,
      "how": "# Debian/Ubuntu\nsudo apt-get install -y build-essential python3-dev libffi-dev\n# macOS\nxcode-select --install\n# then\npip install --no-build-isolation <package>",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "pip install -v <package> 2>&1 | tee pip.log\ngrep -A40 'error:' pip.log",
      "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-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}