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-invoke-setup

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active — — —

Root Cause

Running `python setup.py install` (or `python setup.py develop`) invokes a legacy code path that setuptools has deprecated in favor of PEP 517/518 build frontends like pip.

generic

中文

运行 `python setup.py install`(或 `python setup.py develop`)会调用 setuptools 已弃用的旧代码路径,官方推荐使用 PEP 517/518 构建前端(如 pip)。

Workarounds

  1. 95% success
    Use pip: pip install . (pip invokes the PEP 517 build backend automatically)
  2. 93% success
    Build a wheel first: python -m build && pip install dist/*.whl
  3. 94% success
    For editable installs: pip install -e .

Dead Ends

Common approaches that don't work:

  1. 70% fail

    Suppresses the message but leaves the deprecated install path; future setuptools versions will remove it and break the build.

  2. 75% fail

    Pinning to an old setuptools breaks compatibility with modern pyproject.toml-based projects and other dependencies.

  3. 80% fail

    The --user flag does not change the deprecated code path; the warning persists and the install may still fail on modern Python.