# 错误：无效的要求：'-e git+https://github.com/user/repo.git#egg=package' - 期望有效的需求名称

- **ID:** `python/pip-requirements-file-parse-error`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

requirements.txt 中的可编辑安装格式格式错误，通常缺少 -e 标志或 URL 语法不正确。

## 版本兼容性

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

## 解决方案

1. **Use the correct editable install format** (95% 成功率)
   ```
   In requirements.txt: `-e git+https://github.com/user/repo.git#egg=package` (ensure no extra characters).
   ```
2. **Install directly with pip using the -e flag** (90% 成功率)
   ```
   `pip install -e git+https://github.com/user/repo.git#egg=package`
   ```

## 无效尝试

- **Removing the -e flag and treating it as a regular URL** — Without -e, pip will try to install from the URL but may not handle it as an editable install. (60% 失败率)
- **Adding extra spaces around the URL** — The syntax is strict; extra spaces may break parsing. (80% 失败率)
