带有URL的pip -U -r requirements.txt会不断重新安装

gak*_*gak 7 python django pip

我正在使用Django的测试版,下载页面建议使用URL.

requirements.txt条目只是URL:

https://www.djangoproject.com/download/1.7b3/tarball/
Run Code Online (Sandbox Code Playgroud)

当我运行pip install -U -r requirements.txt它时总是重新安装Django.有没有办法在requirements.txt行中指定版本,例如...tarball/#egg=Django==1.7b3

我喜欢在开发时使用每个包的最新版本,所以我使用-U.

也许有更好的方法来解决这个问题?

小智 6

您应该尝试将其中一行添加到requirements.txt中

-e https://github.com/django/django.git#egg=django
Run Code Online (Sandbox Code Playgroud)

还指向特定提交

-e https://github.com/django/django.git@b8d255071ead897cf68120cd2fae7c91326ca2cc#egg=django
Run Code Online (Sandbox Code Playgroud)

或标记

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

阅读pip的文档,还有很多其他的例子