# 错误：命令以退出状态 1 出错：python setup.py egg_info 请查看日志以获取完整命令输出。

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

## 根因

包的 setup.py 在 egg_info 生成期间失败，通常是由于缺少依赖项或语法错误。

## 版本兼容性

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

## 解决方案

1. **Install required build dependencies manually** (85% 成功率)
   ```
   pip install setuptools wheel && pip install mypackage
   ```
2. **Use a pre-built wheel if available** (75% 成功率)
   ```
   pip install mypackage --only-binary :all:
   ```

## 无效尝试

- **Reinstalling the package with --no-cache-dir** — Caching is not the root cause; the setup.py itself is broken. (80% 失败率)
- **Installing in a different directory** — The error is inherent to the package code, not the installation path. (90% 失败率)
