# 错误：命令 'gcc' 失败：没有那个文件或目录

- **ID:** `python/setuptools-cython-build-error-missing-compiler`
- **领域:** python
- **类别:** system_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

构建带有 C 扩展的包需要 C 编译器（gcc），但未安装或不在 PATH 中。这在没有 Visual Studio Build Tools 的 Windows 或最小化 Linux 安装中很常见。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   On Linux: sudo apt-get install build-essential. On macOS: xcode-select --install. On Windows: install Microsoft Visual C++ Build Tools.
   ```
2. **** (85% 成功率)
   ```
   Use conda to install the package, which provides pre-built binaries: conda install <package>.
   ```

## 无效尝试

- **** — If no wheel is available for the platform, pip falls back to source build and fails again. (60% 失败率)
- **** — Clang is not installed, so the command still fails. (90% 失败率)
