ERROR pip auth_error ai_generated true

ERROR: Command errored out with exit status 128: git clone --filter=blob:none 'https://github.com/user/private-repo.git' /tmp/pip-req-build-xxxxx. Check the logs for full command output.

ID: pip/git-clone-authentication-failure

Also available as: JSON · Markdown · 中文
88%Fix Rate
87%Confidence
1Evidence
2023-06-05First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
pip 21.0+ active
Git 2.30+ active
Python 3.10 active

Root Cause

Pip failed to clone a private Git repository because the user has not provided valid authentication credentials (e.g., SSH key, personal access token, or password) for the remote Git server.

generic

中文

Pip 克隆私有 Git 仓库失败,因为用户未提供有效的身份验证凭据(例如 SSH 密钥、个人访问令牌或密码)给远程 Git 服务器。

Official Documentation

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

Workarounds

  1. 90% success Use a personal access token in the URL: pip install git+https://<token>@github.com/user/private-repo.git
    Use a personal access token in the URL: pip install git+https://<token>@github.com/user/private-repo.git
  2. 85% success Configure SSH key and use SSH URL: pip install git+ssh://[email protected]/user/private-repo.git
    Configure SSH key and use SSH URL: pip install git+ssh://[email protected]/user/private-repo.git
  3. 95% success Clone the repo manually first, then install from local path: git clone https://github.com/user/private-repo.git /tmp/repo && pip install /tmp/repo
    Clone the repo manually first, then install from local path: git clone https://github.com/user/private-repo.git /tmp/repo && pip install /tmp/repo

中文步骤

  1. 在 URL 中使用个人访问令牌:pip install git+https://<token>@github.com/user/private-repo.git
  2. 配置 SSH 密钥并使用 SSH URL:pip install git+ssh://[email protected]/user/private-repo.git
  3. 首先手动克隆仓库,然后从本地路径安装:git clone https://github.com/user/private-repo.git /tmp/repo && pip install /tmp/repo

Dead Ends

Common approaches that don't work:

  1. Using https:// URL without credentials and expecting cached credentials to work 50% fail

    Git credential caching may be expired or misconfigured, and pip does not prompt for credentials interactively in non-TTY environments.

  2. Setting git config --global http.proxy incorrectly 30% fail

    Wrong proxy settings can cause authentication to be routed incorrectly or block the connection entirely.

  3. Using sudo pip install with a personal SSH key 60% fail

    Running pip as root changes the SSH agent context, often losing access to the user's SSH keys.