Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 [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.

like image 398
Robeezy Avatar asked Sep 18 '13 22:09

Robeezy


People also ask

Is it possible to use pip to install a package from a private GitHub repository?

Read the Docs uses pip to install your Python packages. If you have private dependencies, you can install them from a private Git repository or a private repository manager.

Can pip install from GitHub?

You can deploy Git locally, or use it via a hosted service, such as Github, Gitlab or Bitbucket. One of the advantages of using pip together with Git is to install the latest commits of unreleased Python packages as branches from Github.

How do I deploy a private GitHub repository?

To register the repository SSH key with your private repository on GitHub, go to the Settings for the repository. On GitHub the repository SSH key is referred to by the term Deploy key. Search down the settings page and find the Deploy keys section and select it. Click on the Add deploy key button.

Can I install Git through pip?

You can use pip to install directly from a git repository. To install flask the shortest version of the command is pip install git+https://github.com/pallets/flask.git .


1 Answers

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

pip install git+ssh://[email protected]/matherbk/django-messages.git 
like image 185
Robeezy Avatar answered Oct 01 '22 02:10

Robeezy