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

其他格式: JSON · Markdown 中文 · English
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.

generic

官方文档

https://pip.pypa.io/en/stable/topics/vcs-support/

解决方案

  1. 确保 SSH 密钥已添加到 SSH 代理:运行 'ssh-add ~/.ssh/id_rsa' 并使用 'ssh -T [email protected]' 验证。
  2. 使用个人访问令牌和 HTTPS:将 requirements.txt 中的需求改为 'git+https://<token>@github.com/user/private-repo.git'。

无效尝试

常见但无效的做法:

  1. 90% 失败

    The underlying issue is the same SSH authentication problem; manual clone will also fail until credentials are fixed.

  2. 40% 失败

    This can work if a token is provided, but if the token is missing or expired, the error persists.