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

× python setup.py egg_info 未能成功运行。
│ 退出码：1
╰─> [12 行输出]
    ModuleNotFoundError: No module named 'Cython'

注意：此错误源自子进程，很可能不是 pip 的问题。
错误：为 somepkg 构建 wheel 失败

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

## 根因

源码分发包的构建步骤需要构建时依赖（Cython、numpy 头文件等），这些依赖未在 pyproject.toml [build-system].requires 中声明，且当前环境中也不存在。

## 版本兼容性

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

## 解决方案

1. **** (90% 成功率)
   ```
   pip install Cython numpy
pip install somepkg
   ```
2. **** (85% 成功率)
   ```
   pip install --only-binary=:all: somepkg
# or specify a wheel index
pip install --index-url https://download.pytorch.org/whl/cpu somepkg
   ```

## 无效尝试

- **** — The missing module is Cython, not pip/setuptools; upgrading build tools does not install Cython. (80% 失败率)
- **** — Disabling build isolation uses the current env, which also lacks Cython, so the same ModuleNotFoundError occurs. (70% 失败率)
