python install_error ai_generated true

SetuptoolsDeprecationWarning:setup.py install 已弃用。请使用 build 和 pip 等基于标准的工具。

SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.

ID: python/setuptools-deprecated-setup-py-test

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

版本兼容性

版本状态引入弃用备注
3.7-3.12 active

根因分析

直接运行 'python setup.py install',setuptools 已弃用该命令,转而推荐 PEP 517 构建后端和 pip。

English

Running 'python setup.py install' directly, which setuptools has deprecated in favor of PEP 517 build backends and pip.

generic

解决方案

  1. 95% 成功率
    pip install .  # or pip install -e . for editable installs
  2. 92% 成功率
    python -m build && pip install dist/*.whl

无效尝试

常见但无效的做法:

  1. 95% 失败

    Flag only silences script location warnings, not the deprecation warning.

  2. 70% 失败

    Downgrading setuptools breaks many modern packages that require recent setuptools features.