简体   繁体   English

安装时如何告诉 pip 保持最新版本的库?

[英]How to tell pip to keep the most updated version of a lib when installing?

my requirements.txt :我的requirements.txt

google-api-python-client>=1.6.2
httplib2==0.9.2
...

In this case google-api-python-client installs the httplib2=0.14.0 .在这种情况下google-api-python-client安装httplib2=0.14.0 But I would be overwritten to the older version on the next line.但我会在下一行被旧版本覆盖。

Of course, in this case, I could act.当然,在这种情况下,我可以采取行动。 But there are some cases that a lib depends on another, that depends on another, etc. So I'm wondering whether there's a way to tell pip to always keep the most recent version of the libs.但是在某些情况下,一个库依赖于另一个库,这取决于另一个库等等。所以我想知道是否有办法告诉pip始终保留最新版本的库。

like: pip install -r --keep-most-recent requirements.txt比如: pip install -r --keep-most-recent requirements.txt

This would mean that pip should install the latest version of the requirements and their dependencies no matter what the version constraints in requirements.txt are, is that right?这意味着pip应该安装最新版本的需求及其依赖关系,无论requirements.txt中的版本约束是什么,对吗? Impossible as far as I know.据我所知不可能。

Not sure exactly what you are trying to achieve but maybe you would prefer working with one of these tools:不确定您要达到的具体目标,但也许您更喜欢使用以下工具之一:

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

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