python install_error ai_generated true

error: invalid command 'bdist_wheel' ERROR: Failed building wheel for foo

ID: python/setuptools-command-not-found-in-setup-py

Also available as: JSON · Markdown · 中文
80%Fix Rate
90%Confidence
0Evidence
2024-03-12First 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 does not know the bdist_wheel command.

generic

中文

构建环境中未安装 `wheel` 包,因此 setuptools 不知道 bdist_wheel 命令。

Workarounds

  1. 95% success
    Install wheel into the build environment:
      pip install --upgrade setuptools wheel
      pip install foo
    If using build isolation, ensure your pyproject.toml [build-system] requires includes 'wheel'.
  2. 90% success
    For legacy setup.py projects, add to pyproject.toml:
      [build-system]
      requires = ["setuptools>=61", "wheel"]
      build-backend = "setuptools.build_meta"

Dead Ends

Common approaches that don't work:

  1. 85% fail

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

  2. 80% fail

    Forces source build, which still needs wheel to produce a wheel; same error.