使用 Pip,如何强制仅升级未升级的软件包?
当使用具有固定版本的 requirements.txt
文件运行 Pip 时,我们会收到以下错误(或类似错误):
VersionConflict: (solrpy 0.9.1
(.../lib/python2.6/site-packages/solrpy-0.9.1-py2.6.egg),
Requirement.parse('solrpy==0.9.3'))
因为版本冲突。使用 pip install -U -rrequirements.txt 修复了这个问题,但它也迫使我们再次下载所有软件包。 Pip 的好处之一是它会知道安装了什么,而不是重新下载/安装它。
有什么办法解决这个问题吗?我想我想要的是“软升级”,它只在软件包发生冲突时才升级它们。
When running Pip with a requirements.txt
file which has fixed versions, we get the following error (or similar):
VersionConflict: (solrpy 0.9.1
(.../lib/python2.6/site-packages/solrpy-0.9.1-py2.6.egg),
Requirement.parse('solrpy==0.9.3'))
because the version conflicts. Using pip install -U -r requirements.txt
fixes this, but it also forces us to download all the packages again. One of the nice things about Pip is that it will know what's installed and not re-download/install it.
Is there any way around this? I guess what I want is a "soft upgrade", where it only upgrades the packages if they conflict.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
似乎有一个突出的错误: http://bitbucket.org/ianb/pip/issue /13/
Seems there is an outstanding bug for this: http://bitbucket.org/ianb/pip/issue/13/
单独升级 solrpy 包:
我认为您可能可以省略
--no-deps
参数,但如果您遇到问题,您可能想先尝试这个,然后再尝试前一个:我不相信有一种方法可以更新已从
requirements.txt
文件安装的更高版本的软件包。Upgrade the solrpy package separately:
I think you can probably omit the
--no-deps
parameter, but you might want to try this first, and the former second, if you have problems:I don't believe there is a way to just update higher versioned packaged already installed from a
requirements.txt
file.