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/setup-py-deprecated

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

版本兼容性

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

根因分析

直接运行 `python setup.py install` 会触发 setuptools 的弃用路径。现代 setuptools 期望通过 PEP 517(pip/build)构建,而不是旧的 setup.py 命令。

English

Running `python setup.py install` directly triggers setuptools' deprecation path. Modern setuptools expects builds via PEP 517 (pip/build) rather than the legacy setup.py commands.

generic

解决方案

  1. 95% 成功率
    Use pip to install the project in editable mode:
    pip install -e .
  2. 92% 成功率
    Build a wheel with the build frontend:
    python -m pip install build
    python -m build

无效尝试

常见但无效的做法:

  1. 70% 失败

    Downgrading setuptools hides the warning but breaks other packages that require newer setuptools APIs.

  2. 60% 失败

    Suppresses the message but the install still uses the deprecated path and may fail on future setuptools.