# 错误：命令 'gcc' 以退出码 1 失败
  ...
  正在构建 'mypkg._ext' 扩展
  gcc -pthread -B /opt/conda/compiler_compat -Wl,--sysroot=/ -Wsign-compare ...
  mypkg/_ext.c:10:10: 致命错误：Python.h: 没有那个文件或目录

- **ID:** `python/setuptools-command-error-build-ext`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

未安装 Python 开发头文件（Python.h），因此 setuptools 在构建步骤中无法编译 C 扩展。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (97% 成功率)
   ```
   On Debian/Ubuntu: sudo apt-get install python3-dev; on RHEL: sudo dnf install python3-devel; then retry pip install.
   ```
2. **** (90% 成功率)
   ```
   Run pip install --only-binary=:all: mypkg to force wheel usage.
   ```

## 无效尝试

- **** — The failure is a missing system header, not an outdated setuptools. (92% 失败率)
- **** — Does not provide Python.h. (90% 失败率)
- **** — The header does not exist at that path without installing python3-dev. (85% 失败率)
