简体   繁体   English

使用Pip,如何强制升级非升级包?

[英]Using Pip, how do I force upgrade non-upgraded packages only?

When running Pip with a requirements.txt file which has fixed versions, we get the following error (or similar): 当使用具有固定版本的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'))

because the version conflicts. 因为版本冲突。 Using pip install -U -r requirements.txt fixes this, but it also forces us to download all the packages again. 使用pip install -U -r requirements.txt解决了这个问题,但它也迫使我们再次下载所有软件包。 One of the nice things about Pip is that it will know what's installed and not re-download/install it. Pip的一个好处是它会知道安装了什么而不是重新下载/安装它。

Is there any way around this? 有没有办法解决? I guess what I want is a "soft upgrade", where it only upgrades the packages if they conflict. 我想我想要的是“软升级”,只有在它们发生冲突时才会升级软件包。

似乎有一个突出的错误: http//bitbucket.org/ianb/pip/issue/13/

Upgrade the solrpy package separately: 单独升级solrpy包:

pip install -U --no-deps solrpy

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: 我想你可以省略--no-deps参数,但是如果你有问题,你可能想先尝试这个,前者是第二个。

pip install -U solrpy

I don't believe there is a way to just update higher versioned packaged already installed from a requirements.txt file. 我不相信有一种方法可以从requirements.txt文件中更新已经安装的更高版本的打包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM