Robeezy Robeezy - 6 months ago 30
Python Question

Trouble installing private github repository using pip

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 git@github.com: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://git@github.com/matherbk/django-messages.gitDownloading/unpacking git+https://git@github.com/matherbk/django-messages.git
Cloning https://git@github.com/matherbk/django-messages.git to /tmp/pip-13ushS-build
Password for 'https://git@github.com':
fatal: Authentication failed
Complete output from command /usr/bin/git clone -q https://git@github.com/matherbk/django-messages.git /tmp/pip-13ushS-build:

----------------------------------------
Command /usr/bin/git clone -q https://git@github.com/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 git@github.com:

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


I can switch
git@github.com
to
robpodosek@github.com
and it lets me install via pip just fine:

(myenv)robbie@ubuntu:~/git$ pip install git+https://robpodosek@github.com/matherbk/django-messages.git
Downloading/unpacking git+https://robpodosek@github.com/matherbk/django-messages.git
Cloning https://robpodosek@github.com/matherbk/django-messages.git to /tmp/pip-SqEan9-build
Password for 'https://robpodosek@github.com':
Running setup.py egg_info for package from git+https://robpodosek@github.com/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 git@github.com 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.

Answer

It worked by using oxyum's suggestion of changing it to:

pip install git+ssh://git@github.com/matherbk/django-messages.git