Trouble installing private github repository using pip

27,460

Solution 1

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

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

Solution 2

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

Share:
27,460
Robeezy
Author by

Robeezy

I just be hanizu all day doe.

Updated on December 20, 2020

Comments

  • Robeezy
    Robeezy over 3 years

    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.