python install_error ai_generated partial

弃用警告:旧式 setup.py install 已弃用。pip 24.0 将强制执行此行为变更。请改用 pip install .

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

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

版本兼容性

版本状态引入弃用备注
3.x active — — —

根因分析

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

English

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

generic

解决方案

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

无效尝试

常见但无效的做法:

  1. 80% 失败

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

  2. 75% 失败

    Temporary and insecure; breaks other tooling expecting modern pip.

  3. 82% 失败

    Does not change the deprecated code path being executed.