python install_error ai_generated true

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

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

Also available as: JSON · Markdown · 中文
80%Fix Rate
86%Confidence
0Evidence
2024-03-12First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active — — —
3.9 active — — —
3.10 active — — —
3.11 active — — —
3.12 active — — —

Root Cause

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

中文

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

Workarounds

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

Dead Ends

Common approaches that don't work:

  1. 85% fail

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

  2. 90% fail

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

  3. 70% fail

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