python install_error ai_generated true

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

ID: python/setuptools-deprecated-setup-py-install

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active — — —

Root Cause

Running `python setup.py install` directly. Modern setuptools emits a DeprecationWarning and eventually will remove direct install support in favor of PEP 517 builds.

generic

中文

直接运行 `python setup.py install`。新版 setuptools 会发出弃用警告,并最终移除直接安装支持,改用 PEP 517 构建。

Workarounds

  1. 98% success
    Use pip to install the project in editable or normal mode: python -m pip install . or python -m pip install -e .
  2. 95% success
    Build a wheel then install it: python -m pip install build && python -m build && python -m pip install dist/*.whl

Dead Ends

Common approaches that don't work:

  1. 60% fail

    Hides the warning but the install path is still deprecated and may produce a broken egg-info layout.

  2. 80% fail

    Pins to an old setuptools that lacks PEP 517 support and breaks other modern packages.