ERROR pip auth_error ai_generated true

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

Also available as: JSON · Markdown · 中文
85%Fix Rate
90%Confidence
1Evidence
2023-06-20First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
pip 23.0 active
pip 23.1 active
pip 23.2 active
pip 24.0 active

Root Cause

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

中文

Pip 无法克隆私有 Git 仓库,因为 SSH 密钥或身份验证凭据缺失、无效或未为运行 pip 的用户配置。

Official Documentation

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

Workarounds

  1. 80% success Ensure SSH key is added to the SSH agent: run 'ssh-add ~/.ssh/id_rsa' and verify with 'ssh -T [email protected]'.
    Ensure SSH key is added to the SSH agent: run 'ssh-add ~/.ssh/id_rsa' and verify with 'ssh -T [email protected]'.
  2. 90% success Use a personal access token with HTTPS: change the requirement to 'git+https://<token>@github.com/user/private-repo.git' in requirements.txt.
    Use a personal access token with HTTPS: change the requirement to 'git+https://<token>@github.com/user/private-repo.git' in requirements.txt.

中文步骤

  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'。

Dead Ends

Common approaches that don't work:

  1. 90% fail

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

  2. 40% fail

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