azureazure-devopsdevops

I'm trying to install the package from a private Azure DevOps repository using the pip install command, but I'm encountering an error



pip install "git+ssh://<repository_ssh_url>"

Collecting git+ssh://****@ssh.dev.azure.com:v3/\*\*\*\*/LindeUtils
  Cloning ssh://****@ssh.dev.azure.com:v3/\*\*\*\*/LindeUtils to c:\users\\*\*\*\*\temp\pip-req-build-_o7f2wcb
  Running command git clone --filter=blob:none --quiet 'ssh://****@ssh.dev.azure.com:v3/\*\*\*\*/LindeUtils' 'C:\Users\\*\*\*\*\Temp\pip-req-build-_o7f2wcb'
  ssh: Could not resolve hostname ssh.dev.azure.com:v3: Name or service not known
  fatal: Could not read from remote repository.

  Please make sure you have the correct access rights
  and the repository exists.
  error: subprocess-exited-with-error

I'm trying to use repository_https_url instead of repository_ssh_url

pip install "git+ssh://<repository_https_url>"

Collecting git+ssh://****@dev.azure.com/\*\*\*\*/LindeUtils
  Cloning ssh://****@dev.azure.com/\*\*\*\*/LindeUtils to c:\users\*\*\*\*\temp\pip-req-build-a_xjd47o
  Running command git clone --filter=blob:none --quiet 'ssh://****@dev.azure.com/\*\*\*\*/LindeUtils' 'C:\Users\\*\*\*\*\Temp\pip-req-build-a_xjd47o'
  ssh: connect to host dev.azure.com port 22: Network is unreachable
  fatal: Could not read from remote repository.

  Please make sure you have the correct access rights
  and the repository exists.
  error: subprocess-exited-with-error

Could you help me analyze the problem?


Solution

  • ssh: Could not resolve hostname ssh.dev.azure.com:v3: Name or service not known

    The cause of the issue is that the azure repo ssh url used in pip install command has issue.

    To solve this issue, we need to change the : before v3 as /.

    For example:

    pip install git+ssh://git@ssh.dev.azure.com/v3/{Org}/{Project}/{RepoName}