# 错误：命令出错，退出状态 128：git clone -q https://github.com/foo/bar.git /tmp/pip-install-... 检查日志以获取完整命令输出。

- **ID:** `python/pip-install-from-git-failed`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

pip 无法克隆 Git 仓库，通常由于网络问题、缺少 git 或需要身份验证。

## 版本兼容性

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

## 解决方案

1. **** (90% 成功率)
   ```
   Ensure git is installed and network accessible: `git --version` and `git clone <url>` manually.
   ```
2. **** (80% 成功率)
   ```
   Use SSH URL or provide credentials: `pip install git+ssh://git@github.com/foo/bar.git`.
   ```

## 无效尝试

- **** — If git is missing or network blocked, retries fail. (80% 失败率)
- **** — Does not fix the clone failure. (90% 失败率)
