How to install Python package from GitHub? [duplic

2019-01-05 07:04发布

This question already has an answer here:

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

标签: python pip
2条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-01-05 07:38

You need to use the proper git URL:

pip install git+git://github.com/jkbr/httpie.git

or

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

Also see the VCS Support section of the pip documentation.

查看更多
Juvenile、少年°
3楼-- · 2019-01-05 07:41

To install Python package from github, you need to clone that repository.

git clone https://github.com/jkbr/httpie.git

Then just run the setup.py file from that directory,

sudo python setup.py install
查看更多
登录 后发表回答