python install_error ai_generated true

错误:无效命令 'bdist_wheel'

error: invalid command 'bdist_wheel'

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

其他格式: JSON · Markdown 中文 · English
80%修复率
88%置信度
0证据数
2024-04-19首次发现

版本兼容性

版本状态引入弃用备注
3.8 active
3.9 active
3.10 active
3.11 active
3.12 active

根因分析

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

English

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

generic

解决方案

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

无效尝试

常见但无效的做法:

  1. 85% 失败

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

  2. 70% 失败

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