python install_error ai_generated true

error: invalid command 'bdist_wheel' ERROR: Failed building wheel for foo ERROR: Could not build wheels for foo, which is required to install pyproject.toml-based projects

ID: python/pip-missing-wheel-bdist-build

Also available as: JSON · Markdown · 中文
80%Fix Rate
87%Confidence
0Evidence
2024-04-09First 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 not installed in the build environment, so setuptools lacks the bdist_wheel command needed to produce a wheel. Common with --no-build-isolation or old build configs.

generic

中文

构建环境中未安装 'wheel' 包,因此 setuptools 缺少生成 wheel 所需的 bdist_wheel 命令。常见于 --no-build-isolation 或旧构建配置。

Workarounds

  1. 93% success
    python -m pip install --upgrade pip setuptools wheel
    pip install foo
  2. 90% success
    # pyproject.toml
    [build-system]
    requires = ["setuptools>=61", "wheel"]
    build-backend = "setuptools.build_meta"

Dead Ends

Common approaches that don't work:

  1. 60% fail

    If wheel is absent in the current env, bdist_wheel is still missing.

  2. 85% fail

    pip version is unrelated to the missing wheel build backend command.