python install_error ai_generated partial

DEPRECATION: Legacy setup.py install is deprecated. pip 24.0 will enforce this behaviour change. Please use pip install . instead.

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

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active — — —

Root Cause

A package or script invokes the legacy `setup.py install` command directly, which pip deprecated in favor of PEP 517 build backends.

generic

中文

某个包或脚本直接调用了旧式 `setup.py install` 命令,而 pip 已弃用它,转而采用 PEP 517 构建后端。

Workarounds

  1. 95% success
    Add a pyproject.toml with [build-system] requires = ['setuptools>=61', 'wheel'] and build-backend = 'setuptools.build_meta'. Then install with pip install .
  2. 85% success
    In CI, use pip<24 with a TODO to migrate; track the offending package and open an upstream issue.

Dead Ends

Common approaches that don't work:

  1. 80% fail

    Hides the warning but does not change the deprecated behavior; future pip versions will error.

  2. 75% fail

    Temporary and insecure; breaks other tooling expecting modern pip.

  3. 82% fail

    Does not change the deprecated code path being executed.