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

时间:2022-11-27 23:01:56

I want to install Django 1.7 via pip. It is currently a development version, so not in pips repositories.

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

So I have installed packages from github before using:

所以在使用之前,我已经安装了github上的软件包:

pip install git+[url here]

Now looking at github, I get the clone url on the django page:

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

https://github.com/django/django.git

But this mentions nothing of the branch. How do I specify that I want version 1.7? Is it somewhere obvious on the github page?

但这并没有提到任何分支。如何指定我想要的版本1.7?是在github上某个显而易见的地方吗?

1 个解决方案

#1


14  

Specify the branch, commit hash, or tag name after an @ at the end of the url:

在url的末尾在@后面指定分支、提交散列或标记名:

pip install git+https://github.com/django/django.git@1.7b3

This will install the version tagged with 1.7b3.

这将安装标记为1.7b3的版本。

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

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

#1


14  

Specify the branch, commit hash, or tag name after an @ at the end of the url:

在url的末尾在@后面指定分支、提交散列或标记名:

pip install git+https://github.com/django/django.git@1.7b3

This will install the version tagged with 1.7b3.

这将安装标记为1.7b3的版本。

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

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