python install_error ai_generated true

错误:子进程退出并报错 × python setup.py egg_info 未能成功运行。

error: subprocess-exited-with-error × python setup.py egg_info did not run successfully.

ID: python/pip-legacy-setup-py-install-failed

其他格式: JSON · Markdown 中文 · English
80%修复率
86%置信度
0证据数
2024-03-12首次发现

版本兼容性

版本状态引入弃用备注
3.8 active — — —
3.9 active — — —
3.10 active — — —
3.11 active — — —
3.12 active — — —

根因分析

pip 尝试使用已弃用的 setup.py egg_info 路径构建源码分发包,但该包的 setup.py 依赖于过时的 setuptools API 或缺少构建依赖。

English

pip attempts to build a source distribution using the deprecated setup.py egg_info path, but the package's setup.py relies on outdated setuptools APIs or a missing build dependency.

generic

解决方案

  1. 75% 成功率
    pip install --upgrade pip setuptools wheel && pip install --no-cache-dir <package>
  2. 65% 成功率
    pip install --no-build-isolation --upgrade setuptools && pip install <package>
  3. 80% 成功率
    pip install --only-binary=:all: <package>

无效尝试

常见但无效的做法:

  1. 85% 失败

    The legacy resolver only changes dependency resolution, not the build backend; setup.py still fails.

  2. 90% 失败

    Editing third-party source inside site-packages breaks package integrity and is overwritten on reinstall.

  3. 70% 失败

    Older pip still invokes the same setup.py path and may lack modern PEP 517 fallbacks.