ERROR
pip
auth_error
ai_generated
partial
错误:命令以退出状态 128 失败:git clone --filter=blob:none '[email protected]:user/private-repo.git' /tmp/pip-install-xxxx 请查看日志获取完整命令输出。
ERROR: Command errored out with exit status 128: git clone --filter=blob:none '[email protected]:user/private-repo.git' /tmp/pip-install-xxxx Check the logs for full command output.
ID: pip/git-clone-permission-denied-private-repo
80%修复率
87%置信度
1证据数
2023-08-22首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| pip 21.3 | active | — | — | — |
| pip 23.0 | active | — | — | — |
| pip 24.0 | active | — | — | — |
根因分析
pip 尝试通过 SSH 克隆私有 Git 仓库,但用户未配置正确的 SSH 密钥,或者仓库 URL 不正确。
English
pip attempts to clone a private Git repository via SSH but the user does not have the correct SSH keys configured, or the repository URL is incorrect.
官方文档
https://pip.pypa.io/en/stable/topics/vcs-support/#git解决方案
-
确保 SSH 密钥已添加到 ssh-agent:`eval "$(ssh-agent -s)" && ssh-add ~/.ssh/id_rsa` 然后用 `ssh -T [email protected]` 测试
-
使用个人访问令牌通过 HTTPS:`pip install git+https://<token>@github.com/user/private-repo.git`
-
先手动克隆仓库,然后从本地路径安装:`git clone [email protected]:user/private-repo.git && pip install ./private-repo`
无效尝试
常见但无效的做法:
-
Re-run pip with --verbose to see more details, assuming it will fix the issue.
95% 失败
Verbose output only shows more log lines; it does not resolve authentication issues.
-
Delete the /tmp/pip-install-xxxx directory and retry.
90% 失败
The error is due to SSH authentication, not a stale cache directory.
-
Use `pip install git+https://github.com/user/private-repo.git` without checking SSH.
70% 失败
HTTPS also requires authentication (password or token) unless the repo is public.