# 错误：无效命令 'bdist_wheel'

- **ID:** `python/pip-setup-py-bdist-wheel-no-command`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

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

## 版本兼容性

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

## 解决方案

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
   ```

## 无效尝试

- **** — wheel is a separate distribution; upgrading setuptools alone does not provide bdist_wheel. (85% 失败率)
- **** — Installs in legacy mode without producing a wheel; also deprecated and may fail on 3.12. (70% 失败率)
