# 错误：无效命令 'bdist_wheel'

错误：为 foo 构建 wheel 失败

- **ID:** `python/setuptools-command-not-found-in-setup-py`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

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

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   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% 成功率)
   ```
   For legacy setup.py projects, add to pyproject.toml:
  [build-system]
  requires = ["setuptools>=61", "wheel"]
  build-backend = "setuptools.build_meta"
   ```

## 无效尝试

- **** — setuptools alone does not provide bdist_wheel; the wheel package is a separate distribution. (85% 失败率)
- **** — Forces source build, which still needs wheel to produce a wheel; same error. (80% 失败率)
