# 错误：子进程以错误退出

× python setup.py bdist_wheel 未成功运行。

- **ID:** `python/pip-subprocess-exited-with-error`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

某个包的构建后端（旧式 setuptools setup.py）在生成 wheel 时崩溃，通常由缺少系统 C 头文件、setuptools 版本不兼容或 Cython/编译器失败引起。

## 版本兼容性

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

## 解决方案

1. **** (85% 成功率)
   ```
   Install the needed system build tools first. On Debian/Ubuntu: `sudo apt-get install build-essential python3-dev libffi-dev libssl-dev`. On macOS: `xcode-select --install`. Then retry `pip install <pkg>`.
   ```
2. **** (80% 成功率)
   ```
   Prefer a prebuilt wheel: `pip install --only-binary=:all: <pkg>`, or upgrade the build toolchain with `pip install --upgrade pip setuptools wheel` before installing.
   ```
3. **** (75% 成功率)
   ```
   Read the full traceback above the error (pip truncates it). Re-run with `pip install -v <pkg>` to see the actual compiler error and address that specific missing dependency.
   ```

## 无效尝试

- **** — The build fails deterministically; retrying does not supply the missing compiler or headers. (95% 失败率)
- **** — Disabling isolation makes pip use the current environment's setuptools, which may be even older and fail the same way. (70% 失败率)
- **** — Older pip still invokes the same broken build backend and loses modern resolver features. (60% 失败率)
