ERROR pip auth_error ai_generated partial

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

Also available as: JSON · Markdown · 中文
80%Fix Rate
87%Confidence
1Evidence
2023-08-22First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
pip 21.3 active
pip 23.0 active
pip 24.0 active

Root Cause

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.

generic

中文

pip 尝试通过 SSH 克隆私有 Git 仓库,但用户未配置正确的 SSH 密钥,或者仓库 URL 不正确。

Official Documentation

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

Workarounds

  1. 85% success Ensure SSH key is added to ssh-agent: `eval "$(ssh-agent -s)" && ssh-add ~/.ssh/id_rsa` then test with `ssh -T [email protected]`
    Ensure SSH key is added to ssh-agent: `eval "$(ssh-agent -s)" && ssh-add ~/.ssh/id_rsa` then test with `ssh -T [email protected]`
  2. 90% 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`
  3. 80% success Clone the repo manually first, then install from local path: `git clone [email protected]:user/private-repo.git && pip install ./private-repo`
    Clone the repo manually first, then install from local path: `git clone [email protected]:user/private-repo.git && pip install ./private-repo`

中文步骤

  1. 确保 SSH 密钥已添加到 ssh-agent:`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`
  3. 先手动克隆仓库,然后从本地路径安装:`git clone [email protected]:user/private-repo.git && pip install ./private-repo`

Dead Ends

Common approaches that don't work:

  1. Re-run pip with --verbose to see more details, assuming it will fix the issue. 95% fail

    Verbose output only shows more log lines; it does not resolve authentication issues.

  2. Delete the /tmp/pip-install-xxxx directory and retry. 90% fail

    The error is due to SSH authentication, not a stale cache directory.

  3. Use `pip install git+https://github.com/user/private-repo.git` without checking SSH. 70% fail

    HTTPS also requires authentication (password or token) unless the repo is public.