python install_error ai_generated true

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

ID: python/setup-py-deprecated

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active — — —

Root Cause

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

中文

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

Workarounds

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

Dead Ends

Common approaches that don't work:

  1. 70% fail

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

  2. 60% fail

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