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/pip-setuptools-deprecation-setup-py-install

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

版本兼容性

版本状态引入弃用备注
3.8 active — — —
3.9 active — — —
3.10 active — — —
3.11 active — — —
3.12 active — — —

根因分析

setuptools 58+ 弃用了直接 `setup.py install` 路径,改用 PEP 517 构建后端;运行它仍可用,但会发出弃用警告并绕过 wheel 缓存。

English

setuptools 58+ deprecated the direct `setup.py install` path in favor of PEP 517 build backends; running it still works but emits a deprecation warning and bypasses wheel caching.

generic

解决方案

  1. 96% 成功率
    Replace `python setup.py install` with `python -m pip install .` or build a wheel first: `python -m pip install build && python -m build`.
  2. 94% 成功率
    For editable dev installs use `python -m pip install -e .` instead of `python setup.py develop`.

无效尝试

常见但无效的做法:

  1. 70% 失败

    Only hides the warning; the deprecated code path still runs and will be removed in a future setuptools release.

  2. 75% 失败

    Pins an old setuptools that lacks modern PEP 517/518 support and breaks other packages expecting current metadata APIs.