# 错误：子进程退出失败：python setup.py egg_info 未成功运行。退出码：1。Cython 编译器错误：/tmp/pip-install-xxx/package/src/foo.pyx:1:0：找不到 'bar.pxd'

- **ID:** `pip/egg-info-failure-requires-cython`
- **领域:** pip
- **类别:** build_error
- **错误码:** `ERROR`
- **验证级别:** ai_generated
- **修复率:** 75%

## 根因

该软件包需要一个 Cython 扩展文件（.pxd），但该文件在源代码分发包中缺失，通常是因为生成该文件的构建脚本在打包前未运行。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| pip 23.2 | active | — | — |
| pip 24.0 | active | — | — |
| setuptools 68.0 | active | — | — |
| Cython 3.0.8 | active | — | — |

## 解决方案

1. ```
   从版本控制系统（如 git）安装该软件包，其中包含生成 .pxd 文件的构建脚本：pip install git+https://github.com/user/package.git
   ```
2. ```
   修补源代码分发包：下载 .tar.gz，解压，运行构建脚本（如 python setup.py build_ext --inplace）生成缺失的 .pxd，然后重新打包并用 pip install ./package-version.tar.gz 安装。
   ```
3. ```
   联系软件包维护者，请求发布包含缺失 .pxd 文件的固定源代码分发包或 wheel。
   ```

## 无效尝试

- **Manually creating a dummy .pxd file with the same name in the package directory** — The .pxd file has specific type declarations and interfaces that must match the .pyx file; a dummy file will cause compilation errors or silent failures. (95% 失败率)
- **Running pip install --no-build-isolation to use system Cython** — The missing .pxd is not a Cython version issue; it's a missing source file that no Cython version can generate without the original build script. (90% 失败率)
- **Installing the package from a pre-built wheel instead of source** — If the package maintainer did not publish a wheel for the platform/Python version, this option is not available. (70% 失败率)
