Skip to content

Commit 9a607ad

Browse files
committed
docs: clarify optional spaces in version requirements
1 parent ded8541 commit 9a607ad

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎source/tutorials/installing-packages.rst‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,16 @@ composed of a project name followed by an optional :term:`version specifier
307307
found in the :ref:`Version specifier specification <version-specifiers>`.
308308
Below are some examples.
309309

310+
Spaces within a requirement specifier are allowed, including around version
311+
operators and commas. They can make manually maintained requirements easier to
312+
read. For example, both ``pip ~= 23.1`` and
313+
``resolvelib > 0.5, != 0.6.0`` are valid requirement specifiers.
314+
In a requirements file, write them directly, one per line. When passing a
315+
specifier containing spaces to ``pip install`` on the command line, quote
316+
the entire requirement so the shell passes it as one argument (for example,
317+
``python -m pip install "pip ~= 23.1"``).
318+
319+
310320
To install the latest version of "SomeProject":
311321

312322
.. tab:: Unix/macOS

0 commit comments

Comments
 (0)