Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Python package from GitHub? [duplicate]

Tags:

python

pip

I want to use a new feature of httpie. This feature is in the github repo https://github.com/jkbr/httpie but not in the release on the python package index https://pypi.python.org/pypi/httpie

How can I install the httpie package from the github repo? I tried

pip install https://github.com/jkbr/httpie 

But I got an error 'could not unpack'


In Nodejs, I can install packages from github like this

npm install git+https://github.com/substack/node-optimist.git 
like image 250
Colonel Panic Avatar asked Mar 07 '13 10:03

Colonel Panic


People also ask

How do I download Python from GitHub?

On GitHub, navigate to the main page of the repository. Click the Clone or download button located under the repository name. A dropdown is displayed. Click on Download ZIP and save the repository as a zip file to your system.

Can I install two versions of a Python package on the same computer?

On the other hand, using two virtualenvs will let you install both versions on the same machine, but not use them at the same time. You best bet is to install both version manually, by putting them in your Python path with a different name. There is currently no clean way to do this.


1 Answers

You need to use the proper git URL:

pip install git+https://github.com/jkbr/httpie.git#egg=httpie 

Also see the VCS Support section of the pip documentation.

Don’t forget to include the egg=<projectname> part to explicitly name the project; this way pip can track metadata for it without having to have run the setup.py script.

like image 90
Martijn Pieters Avatar answered Sep 18 '22 17:09

Martijn Pieters