ERROR
pip
auth_error
ai_generated
true
错误:命令以退出状态 128 失败:git clone --filter=blob:none '[email protected]:user/private-repo.git' /tmp/pip-req-build-xxxxx。请查看日志获取完整命令输出。
ERROR: Command errored out with exit status 128: git clone --filter=blob:none '[email protected]:user/private-repo.git' /tmp/pip-req-build-xxxxx. Check the logs for full command output.
ID: pip/git-clone-exit-status-128
85%修复率
90%置信度
1证据数
2023-06-20首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| pip 23.0 | active | — | — | — |
| pip 23.1 | active | — | — | — |
| pip 23.2 | active | — | — | — |
| pip 24.0 | active | — | — | — |
根因分析
Pip 无法克隆私有 Git 仓库,因为 SSH 密钥或身份验证凭据缺失、无效或未为运行 pip 的用户配置。
English
Pip cannot clone a private Git repository because the SSH key or authentication credentials are missing, invalid, or not configured for the user running pip.
官方文档
https://pip.pypa.io/en/stable/topics/vcs-support/解决方案
-
确保 SSH 密钥已添加到 SSH 代理:运行 'ssh-add ~/.ssh/id_rsa' 并使用 'ssh -T [email protected]' 验证。
-
使用个人访问令牌和 HTTPS:将 requirements.txt 中的需求改为 'git+https://<token>@github.com/user/private-repo.git'。
无效尝试
常见但无效的做法:
-
90% 失败
The underlying issue is the same SSH authentication problem; manual clone will also fail until credentials are fixed.
-
40% 失败
This can work if a token is provided, but if the token is missing or expired, the error persists.