# 错误：无效需求：'-e git+https://github.com/org/repo.git@main#egg=foo'（来自 requirements.txt 第 3 行）
提示：看起来像路径。文件 'requirements.txt' 不存在。

- **ID:** `python/pip-requirement-parse-invalid-editable`
- **领域:** python
- **类别:** data_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

pip 错误解析需求行，通常由于 -e 后多余空格、BOM/编码问题，或该行被当作参数而非需求读取。

## 版本兼容性

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

## 解决方案

1. **** (92% 成功率)
   ```
   # requirements.txt
-e git+https://github.com/org/repo.git@main#egg=foo
# ensure UTF-8 without BOM; one requirement per line
   ```
2. **** (88% 成功率)
   ```
   python -c "import sys; open('requirements.txt', encoding='utf-8-sig').read()"
# convert BOM:
sed -i '1s/^\xEF\xBB\xBF//' requirements.txt
pip install -r requirements.txt
   ```

## 无效尝试

- **** — Loses editable mode; changes how the package resolves imports and breaks local development workflow. (70% 失败率)
- **** — pip does not strip shell-style quotes from requirements lines; the quoted string becomes an invalid requirement. (85% 失败率)
