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

Requirements.txt greater than equal to and then less than?

我的需求文件中有这一行

django>=1.10,<1.11

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

pip manual [doc] has a section on the format of "requirement specifiers". These are documented in PEP-508 [pep] and 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).