python install_error ai_generated true

error: invalid command 'bdist_wheel'

ID: python/pip-setup-py-bdist-wheel-no-command

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active
3.9 active
3.10 active
3.11 active
3.12 active

Root Cause

The wheel package is missing from the build environment, so setuptools cannot register the bdist_wheel command when building a wheel.

generic

中文

构建环境中缺少 wheel 包,因此 setuptools 在构建 wheel 时无法注册 bdist_wheel 命令。

Workarounds

  1. 95% success
    pip install --upgrade wheel setuptools
    python setup.py bdist_wheel
  2. 95% success
    pip install build
    python -m build
    # produces dist/*.whl and dist/*.tar.gz

Dead Ends

Common approaches that don't work:

  1. 85% fail

    wheel is a separate distribution; upgrading setuptools alone does not provide bdist_wheel.

  2. 70% fail

    Installs in legacy mode without producing a wheel; also deprecated and may fail on 3.12.