Python/pip,如何从github安装特定版本的git存储库(什么是正确的URL)?

wob*_*col 11 python git django github

我想通过pip安装Django 1.7.它目前是一个开发版本,因此不在pips存储库中.

所以我在使用之前已经从github安装了包:

pip install git+[url here]
Run Code Online (Sandbox Code Playgroud)

现在看github,我在django页面上获得了克隆url:

https://github.com/django/django.git
Run Code Online (Sandbox Code Playgroud)

但是这没有提及分支.如何指定我想要1.7版本?它是否在github页面上显而易见?

for*_*ord 20

在url末尾后指定分支,提交哈希标记名称@:

pip install git+https://github.com/django/django.git@1.7b3
Run Code Online (Sandbox Code Playgroud)

这将安装标记为1.7b3版本.

参考:https://pip.pypa.io/en/latest/reference/pip_install.html#git

  • 如果你想把它放在你的requirements.txt:-e git + https://github.com/django/django.git@1.7c1#egg=Django (7认同)