# 错误：为 mypackage 构建 wheel 失败
  错误：命令 'cmake' 失败：没有那个文件或目录

- **ID:** `python/pip-wheel-building-failure`
- **领域:** python
- **类别:** system_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

该包需要构建工具（如 cmake），但系统上未安装。

## 版本兼容性

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

## 解决方案

1. **Install cmake and ensure it is in PATH** (90% 成功率)
   ```
   On Ubuntu: `sudo apt-get install cmake`. On macOS: `brew install cmake`. Verify with `cmake --version`.
   ```
2. **Use a pre-built wheel from PyPI or a third-party index** (75% 成功率)
   ```
   `pip install --only-binary=:all: mypackage` or download a .whl file and install with `pip install mypackage.whl`
   ```

## 无效尝试

- **Installing cmake but not adding it to PATH** — pip cannot find the cmake executable if it's not in PATH. (50% 失败率)
- **Using --no-build-isolation to use system-installed cmake** — If cmake is not installed at all, this flag does not help. (80% 失败率)
