@@ -36,9 +36,7 @@ directly from distribution files.
36
36
37
37
38
38
The most common scenario is to install from `PyPI `_ using :ref: `Requirement
39
- Specifiers`
40
-
41
- ::
39
+ Specifiers` ::
42
40
43
41
$ pip install SomePackage # latest version
44
42
$ pip install SomePackage==1.0.4 # specific version
@@ -144,9 +142,7 @@ Requirements Files
144
142
==================
145
143
146
144
"Requirements files" are files containing a list of items to be
147
- installed using :ref: `pip install ` like so:
148
-
149
- ::
145
+ installed using :ref: `pip install ` like so::
150
146
151
147
pip install -r requirements.txt
152
148
@@ -232,9 +228,7 @@ contents is nearly identical to :ref:`Requirements Files`. There is one key
232
228
difference: Including a package in a constraints file does not trigger
233
229
installation of the package.
234
230
235
- Use a constraints file like so:
236
-
237
- ::
231
+ Use a constraints file like so::
238
232
239
233
pip install -c constraints.txt
240
234
@@ -848,16 +842,14 @@ Understanding your error message
848
842
When you get a ``ResolutionImpossible `` error, you might see something
849
843
like this:
850
844
851
- ::
852
-
853
- pip install package_coffee==0.44.1 package_tea==4.3.0
854
-
855
- ::
845
+ .. code-block :: console
856
846
857
- Due to conflicting dependencies pip cannot install package_coffee and
858
- package_tea:
859
- - package_coffee depends on package_water<3.0.0,>=2.4.2
860
- - package_tea depends on package_water==2.3.1
847
+ $ pip install package_coffee==0.44.1 package_tea==4.3.0
848
+ ...
849
+ Due to conflicting dependencies pip cannot install
850
+ package_coffee and package_tea:
851
+ - package_coffee depends on package_water<3.0.0,>=2.4.2
852
+ - package_tea depends on package_water==2.3.1
861
853
862
854
In this example, pip cannot install the packages you have requested,
863
855
because they each depend on different versions of the same package
@@ -876,27 +868,37 @@ commonly understood comparison operators to specify the required version
876
868
However, Python packaging also supports some more complex ways for
877
869
specifying package versions (e.g. ``~= `` or ``* ``):
878
870
879
- .. csv-table ::
880
- :header: "Operator", "Description", "Example"
881
-
882
- ``> ``, "Any version greater than the specified version", "``>3.1 ``: any
883
- version greater than 3.1"
884
- ``< ``, "Any version less than the specified version", "``<3.1 ``: any version
885
- less than ``3.1 ``"
886
- ``<= ``, "Any version less than or equal to the specified version", "``<=3.1 ``:
887
- any version less than or equal to ``3.1 ``"
888
- ``>= ``, "Any version greater than or equal to the specified
889
- version", "``>=3.1 ``: version ``3.1 `` and greater"
890
- ``== ``, "Exactly the specified version", ``==3.1 ``: only version ``3.1 ``
891
- ``!= ``, "Any version not equal to the specified version", "``!=3.1 ``: any
892
- version other than ``3.1 ``"
893
- ``~= ``, "Any compatible release. Compatible releases are releases that are
894
- within the same major or minor version, assuming the package author is using
895
- semantic versioning.", "``~=3.1 ``: version ``3.1 `` or later, but not version
896
- ``4.0 `` or later. ``~=3.1.2 ``: version ``3.1.2 `` or later, but not
897
- version ``3.2.0 `` or later."
898
- ``* ``,Can be used at the end of a version number to represent "all", "``== 3.
899
- 1.* ``: any version that starts with ``3.1 ``. Equivalent to ``~=3.1.0 ``."
871
+ +----------+---------------------------------+--------------------------------+
872
+ | Operator | Description | Example |
873
+ +==========+=================================+================================+
874
+ | ``> `` | Any version greater than | ``>3.1 ``: any version |
875
+ | | the specified version. | greater than ``3.1 ``. |
876
+ +----------+---------------------------------+--------------------------------+
877
+ | ``< `` | Any version less than | ``<3.1 ``: any version |
878
+ | | the specified version. | less than ``3.1 ``. |
879
+ +----------+---------------------------------+--------------------------------+
880
+ | ``<= `` | Any version less than or | ``<=3.1 ``: any version |
881
+ | | equal to the specified version. | less than or equal to ``3.1 ``. |
882
+ +----------+---------------------------------+--------------------------------+
883
+ | ``>= `` | Any version greater than or | ``>=3.1 ``: |
884
+ | | equal to the specified version. | version ``3.1 `` and greater. |
885
+ +----------+---------------------------------+--------------------------------+
886
+ | ``== `` | Exactly the specified version. | ``==3.1 ``: only ``3.1 ``. |
887
+ +----------+---------------------------------+--------------------------------+
888
+ | ``!= `` | Any version not equal | ``!=3.1 ``: any version |
889
+ | | to the specified version. | other than ``3.1 ``. |
890
+ +----------+---------------------------------+--------------------------------+
891
+ | ``~= `` | Any compatible release. | ``~=3.1 ``: version ``3.1 `` |
892
+ | | Compatible releases are | or later, but not |
893
+ | | releases that are within the | version ``4.0 `` or later. |
894
+ | | same major or minor version, | ``~=3.1.2 ``: version ``3.1.2 `` |
895
+ | | assuming the package author | or later, but not |
896
+ | | is using semantic versioning. | version ``3.2.0 `` or later. |
897
+ +----------+---------------------------------+--------------------------------+
898
+ | ``* `` | Can be used at the end of | ``==3.1.* ``: any version |
899
+ | | a version number to represent | that starts with ``3.1 ``. |
900
+ | | *all *, | Equivalent to ``~=3.1.0 ``. |
901
+ +----------+---------------------------------+--------------------------------+
900
902
901
903
The detailed specification of supported comparison operators can be
902
904
found in :pep: `440 `.
@@ -1181,11 +1183,11 @@ How to test
1181
1183
- If you use pip to install your software, try out the new resolver
1182
1184
and let us know if it works for you with ``pip install ``. Try:
1183
1185
1184
- - installing several packages simultaneously
1185
- - re-creating an environment using a ``requirements.txt `` file
1186
- - using ``pip install --force-reinstall `` to check whether
1187
- it does what you think it should
1188
- - using constraints files
1186
+ - installing several packages simultaneously
1187
+ - re-creating an environment using a ``requirements.txt `` file
1188
+ - using ``pip install --force-reinstall `` to check whether
1189
+ it does what you think it should
1190
+ - using constraints files
1189
1191
1190
1192
- If you have a build pipeline that depends on pip installing your
1191
1193
dependencies for you, check that the new resolver does what you
0 commit comments