From 9a607ad0e1e4c35628dd0283de7d04b027b1c789 Mon Sep 17 00:00:00 2001 From: Harshit Sharma <66710144+harshitethic@users.noreply.github.com> Date: Tue, 13 Oct 2026 06:26:43 +0530 Subject: [PATCH] docs: clarify optional spaces in version requirements --- source/tutorials/installing-packages.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/tutorials/installing-packages.rst b/source/tutorials/installing-packages.rst index 4c9b950306..587690f788 100644 --- a/source/tutorials/installing-packages.rst +++ b/source/tutorials/installing-packages.rst @@ -307,6 +307,16 @@ composed of a project name followed by an optional :term:`version specifier found in the :ref:`Version specifier specification `. Below are some examples. +Spaces within a requirement specifier are allowed, including around version +operators and commas. They can make manually maintained requirements easier to +read. For example, both ``pip ~= 23.1`` and +``resolvelib > 0.5, != 0.6.0`` are valid requirement specifiers. +In a requirements file, write them directly, one per line. When passing a +specifier containing spaces to ``pip install`` on the command line, quote +the entire requirement so the shell passes it as one argument (for example, +``python -m pip install "pip ~= 23.1"``). + + To install the latest version of "SomeProject": .. tab:: Unix/macOS