Trouble installing private github repository using pip

Question:

To preface, I have already seen this question Is it possible to use pip to install a package from a private github repository?

I am trying to install a package from a private repository that I have access to using pip.

I am able to directly clone it like so:

(myenv)robbie@ubuntu:~/git$ git clone [email protected]:matherbk/django-messages.git
Cloning into 'django-messages'...
remote: Counting objects: 913, done.
remote: Compressing objects: 100% (345/345), done.
remote: Total 913 (delta 504), reused 913 (delta 504)
Receiving objects: 100% (913/913), 165.73 KiB, done.
Resolving deltas: 100% (504/504), done.

But when I try to install it via pip (my virtualenv is activated):

(myenv)robbie@ubuntu:~/git$ pip install git+https://[email protected]/matherbk/django-messages.gitDownloading/unpacking git+https://[email protected]/matherbk/django-messages.git
  Cloning https://[email protected]/matherbk/django-messages.git to /tmp/pip-13ushS-build
Password for 'https://[email protected]': 
fatal: Authentication failed
  Complete output from command /usr/bin/git clone -q https://[email protected]/matherbk/django-messages.git /tmp/pip-13ushS-build:

----------------------------------------
Command /usr/bin/git clone -q https://[email protected]/matherbk/django-messages.git /tmp/pip-13ushS-build failed with error code 128 in None
Storing complete log in /home/robbie/.pip/pip.log

I tried typing in my password but it failed. However I am ssh authenticated for [email protected]:

(myenv)robbie@ubuntu:~/git$ ssh -T [email protected]
Hi robpodosek! You've successfully authenticated, but GitHub does not provide shell access.

I can switch [email protected] to [email protected] and it lets me install via pip just fine:

(myenv)robbie@ubuntu:~/git$ pip install git+https://[email protected]/matherbk/django-messages.git
Downloading/unpacking git+https://[email protected]/matherbk/django-messages.git
  Cloning https://[email protected]/matherbk/django-messages.git to /tmp/pip-SqEan9-build
Password for 'https://[email protected]': 
  Running setup.py egg_info for package from git+https://[email protected]/matherbk/django-messages.git

    warning: no files found matching 'README'
Installing collected packages: django-messages
  Running setup.py install for django-messages

    warning: no files found matching 'README'
Successfully installed django-messages
Cleaning up...

However I want to do what the first mentioned article does by using [email protected] so that I don’t have to add my username into a requirements.txt file and add that to version control.

Any thoughts? I previously had this working but had to boot up a fresh image. Thanks ahead of time.

Asked By: Robeezy

||

Answers:

It worked by using oxyum’s suggestion of changing the : to a /:

pip install git+ssh://[email protected]/matherbk/django-messages.git
Answered By: Robeezy

Make sure you use github.com/account instead of github.com:account
see Git+SSH dependencies have subtle (yet critical) differences from git clone

Answered By: Payman

Had virtualenv activated and had to install a series of applications from github.com from a text file.

(venv)$ cat requirements.txt
-e git://github.com/boto/botocore.git@develop#egg=botocore
-e git://github.com/boto/jmespath.git@develop#egg=jmespath
-e git://github.com/boto/s3transfer.git@develop#egg=s3transfer
nose==1.3.3
mock==1.3.0
wheel==0.24.0
unittest2==0.5.1; python_version == '2.6'

(venv)$ pip install -r requirements.txt
Ignoring unittest2: markers 'python_version == "2.6"' don't match your environment Obtaining botocore from git+git://github.com/boto/botocore.git@develop#egg=botocore (from -r requirements.txt (line 1))
Cloning git://github.com/boto/botocore.git (to develop) to ./venv/src/botocore
fatal: unable to connect to github.com:
github.com[0: 192.30.253.112]: errno=Connection timed out
github.com[1: 192.30.253.113]: errno=Connection timed out

Command "git clone -q git://github.com/boto/botocore.git 
/home/ubuntu/utils/boto3/venv/src/botocore" failed with error code 128 in None

However, as @Robeezy suggested, edited the requirement.txt and changed from

-e git://github.com...

to

-e git+https://github.com...

That is the link provided if you were to clone from the site (only options were Clone or Download).

So, thank you! It did work finally.

Answered By: dat789

If you’re installing with pip install git+https://github.com/repo and getting this error, make sure your username and password are correct. I was getting this error because I was incorrectly entering my password.

Answered By: Vito
Categories: questions Tags: , , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.