python install_error ai_generated true

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

ID: python/pip-setuptools-deprecation-setup-py-install

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active — — —
3.9 active — — —
3.10 active — — —
3.11 active — — —
3.12 active — — —

Root Cause

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

中文

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

Workarounds

  1. 96% success
    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% success
    For editable dev installs use `python -m pip install -e .` instead of `python setup.py develop`.

Dead Ends

Common approaches that don't work:

  1. 70% fail

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

  2. 75% fail

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