# 错误：无法检测 'git+https://github.com/org/repo.git@main' 的需求名称，请使用 #egg=your_package_name 指定一个。

- **ID:** `python/pip-git-url-without-egg-fragment`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

pip 无法从没有旧式 `#egg=` 片段或 PEP 508 名称前缀的原始 VCS URL 推断出分发包名称。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   pip install 'your-package @ git+https://github.com/org/repo.git@main'
   ```
2. **** (90% 成功率)
   ```
   pip install 'git+https://github.com/org/repo.git@main#egg=your-package'
   ```

## 无效尝试

- **** — Trusted-host is unrelated to name detection. (95% 失败率)
- **** — pip still needs a name to record in metadata. (90% 失败率)
- **** — Works but loses VCS provenance and complicates updates; not a general fix for requirements files. (40% 失败率)
