如何从 GitHub 安装 Python 包? [英] How to install Python package from GitHub?
问题描述
我想使用 httpie 的一个新功能.此功能在 github 存储库 https://github.com/jkbr/httpie 中,但不在发行版中关于 python 包索引 https://pypi.python.org/pypi/httpie
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
如何从 github 存储库安装 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'
在Nodejs中,我可以像这样从github安装包
In Nodejs, I can install packages from github like this
npm install git+https://github.com/substack/node-optimist.git
推荐答案
你需要使用正确的 git URL:
You need to use the proper git URL:
pip install git+https://github.com/jkbr/httpie.git#egg=httpie
另请参阅VCS 支持部分 pip 文档.
Also see the VCS Support section of the pip documentation.
不要忘记将 egg=
部分包含到 明确命名项目;这样 pip 就可以跟踪它的元数据,而无需运行 setup.py 脚本.
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.
这篇关于如何从 GitHub 安装 Python 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!