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

ID: pip/error-command-errored-out-exit-status-128-git-clone

Also available as: JSON · Markdown · 中文
85%Fix Rate
90%Confidence
1Evidence
2024-01-10First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
pip 21.0 active
pip 22.0 active
pip 23.0 active

Root Cause

Pip failed to clone a private Git repository because the SSH key or authentication credentials are not configured correctly, or the user lacks access to the repository.

generic

中文

pip克隆私有Git仓库失败,因为SSH密钥或认证凭据配置不正确,或用户缺少对仓库的访问权限。

Official Documentation

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

Workarounds

  1. 90% success Add your SSH key to the SSH agent: `eval "$(ssh-agent -s)" && ssh-add ~/.ssh/id_rsa` and test with `ssh -T [email protected]`.
    Add your SSH key to the SSH agent: `eval "$(ssh-agent -s)" && ssh-add ~/.ssh/id_rsa` and test with `ssh -T [email protected]`.
  2. 85% success Use a personal access token with HTTPS: `pip install git+https://<token>@github.com/user/private-repo.git`
    Use a personal access token with HTTPS: `pip install git+https://<token>@github.com/user/private-repo.git`

中文步骤

  1. 将SSH密钥添加到SSH代理:`eval "$(ssh-agent -s)" && ssh-add ~/.ssh/id_rsa` 并用 `ssh -T [email protected]` 测试。
  2. 使用个人访问令牌通过HTTPS安装:`pip install git+https://<token>@github.com/user/private-repo.git`

Dead Ends

Common approaches that don't work:

  1. 70% fail

    HTTPS authentication requires a personal access token or password, which is not set in the URL.

  2. 60% fail

    If SSH key is not set up, manual clone will also fail with permission denied.