gpt4 book ai didi

python - Requirements.txt 大于等于然后小于?

转载 作者:太空狗 更新时间:2023-10-29 17:45:12 25 4
gpt4 key购买 nike

我的需求文件中有这一行

django>=1.10,<1.11

这是否意味着我需要 Django 版本 >= 1.10 然后低于 1.11

最佳答案

pip manual [doc]有一节关于“需求说明符”的格式。这些记录在 PEP-508 [pep] 中和 PEP-440 [pep] :

The comparison operator determines the kind of version clause:

  1. ~=: Compatible release clause
  2. ==: Version matching clause
  3. !=: Version exclusion clause
  4. <=, >=: Inclusive ordered comparison clause
  5. <, >: Exclusive ordered comparison clause
  6. ===: Arbitrary equality clause.

The comma (",") is equivalent to a logical and operator: a candidate version must match all given version clauses in order to match the specifier as a whole.

所以在你的情况下,这意味着 Django 版本是 1.10或更高而不是 1.11或更高(所以 1.10 很好, 1.10.1 也可以,但不是 1.111.11.12.0.1 )。

关于python - Requirements.txt 大于等于然后小于?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50842144/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com