2

I am trying to install a private python package from a bitbucket repo with sshkeys by using following command

pip install git+ssh://git@bitbucket.org:username/package.git

but i am getting following error.

ssh: Could not resolve hostname bitbucket.org:pak-sign: 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. Command "git clone -q ssh://git@bitbucket.org:username/package.git /tmp/pip-7j4r53en-build" failed with error code 128 in None

but when i try to clone this repo ssh is working fine and i am able to clone it successfully. I am sure that my ssh-keys are correct and repository exists. I have tried various solutions but still not able to install it. Any help is appreciated.

Shoaib Iqbal
  • 2,420
  • 4
  • 26
  • 51
  • 1
    Possible duplicate of [bitbucket can't pull/push from repository](https://stackoverflow.com/questions/29747969/bitbucket-cant-pull-push-from-repository) – LuFFy Sep 07 '18 at 11:10

2 Answers2

5

The git@bitbucket.org:owner/repo format does not work when the git+ssh:// scheme is specified. (With git+ssh:// present, SSH will assume that the stuff behind the colon is a port number.) Instead, use a slash between bitbucket.org and the rest of the path:

git+ssh://git@bitbucket.org/username/package.git

Jim Redmond
  • 4,139
  • 1
  • 14
  • 18
  • Weirdly, i pushed a repo to my org's bitbucket account and if i use my username, it didn't work, but worked with using org instead of my username in aforementioned format. There should be a manual for this :( . – Saurabh Agrawal Aug 26 '21 at 09:10
1

Try changing your DNS as Google Public DNS IP addresses :

The Google Public DNS IP addresses (IPv4) are as follows:

8.8.8.8
8.8.4.4

The Google Public DNS IPv6 addresses are as follows:

2001:4860:4860::8888
2001:4860:4860::8844

Check the Documentation for more details : How to Change your DNS servers settings

LuFFy
  • 8,799
  • 10
  • 41
  • 59