Pip: 安装多个软件包时,Pip不会更新过旧的依赖项

创建于 2019-10-04  ·  3评论  ·  资料来源: pypa/pip

描述
我将讨论特定的程序包,因为已经在野外发现了这种情况(HypothesisWorks / hypothesis#2113):我们最近将对attrs>=16.0install_requires依赖关系更新为attrs>=19.2 ,安装最新版本的假设的基础也将更新用户的属性。

  • pip install hypothesis确实可以工作。
  • 如果尚未安装较旧版本的attrs,则pip install pytest hypothesis可以工作。

看起来,当一个安装命令中列出了多个软件包时,仅针对列出的第一个软件包评估已安装依赖关系的兼容性,而对于以后的软件包,则检查存在关系而不检查依赖关系的版本。 这也会影响需求文件的使用。

预期行为

无论列出要安装或已经存在的其他软件包, pip install hypothesis都应该导致安装兼容的软件包集或出现错误消息-而不是损坏的环境。

如何繁殖

[tox]
skipsdist=True
[testenv]
deps =
    pip
    attrs==19.1.0
commands =
    ## Execute the problematic install command
    # pip install hypothesis  # works
    # pip install hypothesis pytest  # works
    pip install pytest hypothesis  #  fails, as does `pip install attrs hypothesis` !
    # pip install --upgrade pytest hypothesis  # works

    ## Check that the installed packages are compatible
    python -c "import hypothesis"

然后运行tox --recreate以重新创建虚拟环境并运行命令。

(感谢所有在pip ,它非常有价值,非常感谢😍)

dependency resolution auto-locked bug

所有3条评论

感谢您提供详细信息并轻松复制! 非常感激!

这基本上是#988。 快速总结:

  • pip会以红色显示一条消息,所有大写字母ERROR
    ERROR: hypothesis 4.38.2 has requirement attrs>=19.2.0, but you'll have attrs 19.1.0 which is incompatible.
  • 使用pip check作为CI的一部分,以确保pip不会做一些愚蠢的事情。
  • 使用pip-tools (用更好的解析器包扎点)或pipenv (使用pip-tools )或poetry (具有自己的解析器)来避免这种情况点子解析器的怪癖。

啊,我明白了! 我检查了问题的最后几页,但没有回过头...很高兴以重复的形式结束此问题,因为我认为它没有任何额外的信息?

关闭为#988的重复项。

此页面是否有帮助?
0 / 5 - 0 等级