使用特定的SVN版本时,PIP始终会重新安装软件包 [英] PIP always reinstalls package when using specific SVN revision
问题描述
当指定了特定的SVN版本时,PIP始终下载并安装软件包(大大降低了同步过程的速度).
PIP always downloads and installs a package when a specific SVN revision is specified (slowing the syncing process considerably).
有没有解决的办法?通常pip会检测到该软件包已在环境中安装,并提示您使用--upgrade
.
Is there a way around this? Normally pip detects that the package is already installed in the environment and prompts to use --upgrade
.
我的pip_requirements文件包含以下行:
My pip_requirements file has the following line:
svn+http://code.djangoproject.com/svn/django/trunk/@16406#egg=Django1.4A
感谢您的帮助!
- 必须将鸡蛋名称指定为确切的python软件包名称.
- 不得使用
-e
标志. - 不适用于PIP版本
0.7
,适用于1.0.2
.
- Must specify egg name as exact python package name.
- Must not use
-e
flag. - Does not work on PIP version
0.7
, works on1.0.2
.
推荐答案
上个周末我实际上是围绕点子进行黑客攻击,我相信我对你的点子困境有解释.问题只是pip本身的局限性.由于安装过程的工作方式,#egg=[egg-name]
部分必须正确命名为setup.py的名称kwarg(这是PyPI上的已知名称)中标识的实际项目名称.
I was actually hacking around pip this past weekend and I believe I have the explanation to your pip woes. The problem is just a limitation within pip itself. Due to the way the installation process works the #egg=[egg-name]
portion must be named correctly to the actual project's name identified within the setup.py's name kwarg (this is the name known on PyPI).
您的行:
svn+http://code.djangoproject.com/svn/django/trunk/@16406#egg=Django1.4A
应该是:
svn+http://code.djangoproject.com/svn/django/trunk/@16406#egg=django
长答案
据我所知,安装过程实际上会执行以下操作(如果我输入错了,Ian Bicking会让我失望:-P)
Long Answer
The install process actually does the following to my understanding (Ian Bicking strike me down if I'm wrong :-P)
- 收到您的要求后,它会根据vcs + [url]结构确定链接是它知道的VCS.
- 它将签出代码到您环境中的临时目录中.
- 它运行setup.py(我相信egg_info和install都可以)
- 已检出代码的临时目录已从文件系统中删除
因此,一旦完成第3步并安装了已签出的源代码,Django就被称为django
(不区分大小写).但是,如果保留当前的需求行,则pip将搜索Django1.4A
.找不到与该名称匹配的软件包,它将再次签出源代码并尝试安装它.
So once step 3 has completed and your checked out source has installed, Django is known to pip as django
(case-insensitive). However, if you keep your current requirements line, pip will search for for Django1.4A
. Not finding a package matching that name, it will checkout the source code again and attempt to install it.
这篇关于使用特定的SVN版本时,PIP始终会重新安装软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!