@@ -1127,37 +1127,46 @@ Examples
1127
1127
1128
1128
py -m pip install --index-url http://my.package.repo/simple/ SomePackage
1129
1129
1130
- Search an additional index during install, in addition to ` PyPI `_
1130
+ Install from a local flat directory containing archives (and don't scan indexes):
1131
1131
1132
1132
.. tab :: Unix/macOS
1133
1133
1134
1134
.. code-block :: shell
1135
1135
1136
- python -m pip install --extra-index-url http://my.package.repo/simple SomePackage
1136
+ python -m pip install --no-index --find-links=file:///local/dir/ SomePackage
1137
+ python -m pip install --no-index --find-links=/local/dir/ SomePackage
1138
+ python -m pip install --no-index --find-links=relative/dir/ SomePackage
1137
1139
1138
1140
.. tab :: Windows
1139
1141
1140
1142
.. code-block :: shell
1141
1143
1142
- py -m pip install --extra-index-url http://my.package.repo/simple SomePackage
1144
+ py -m pip install --no-index --find-links=file:///local/dir/ SomePackage
1145
+ py -m pip install --no-index --find-links=/local/dir/ SomePackage
1146
+ py -m pip install --no-index --find-links=relative/dir/ SomePackage
1143
1147
1144
- Install from a local flat directory containing archives (and don't scan indexes):
1148
+ Search an additional index during install, in addition to `PyPI `_
1149
+
1150
+ .. warning ::
1151
+
1152
+ Using this option to search for packages which are not in the main
1153
+ repository (such as private packages) is unsafe, per a security
1154
+ vulnerability called
1155
+ `dependency confusion <https://azure.microsoft.com/en-us/resources/3-ways-to-mitigate-risk-using-private-package-feeds/ >`_:
1156
+ an attacker can claim the package on the public repository in a way that
1157
+ will ensure it gets chosen over the private package.
1145
1158
1146
1159
.. tab :: Unix/macOS
1147
1160
1148
1161
.. code-block :: shell
1149
1162
1150
- python -m pip install --no-index --find-links=file:///local/dir/ SomePackage
1151
- python -m pip install --no-index --find-links=/local/dir/ SomePackage
1152
- python -m pip install --no-index --find-links=relative/dir/ SomePackage
1163
+ python -m pip install --extra-index-url http://my.package.repo/simple SomePackage
1153
1164
1154
1165
.. tab :: Windows
1155
1166
1156
1167
.. code-block :: shell
1157
1168
1158
- py -m pip install --no-index --find-links=file:///local/dir/ SomePackage
1159
- py -m pip install --no-index --find-links=/local/dir/ SomePackage
1160
- py -m pip install --no-index --find-links=relative/dir/ SomePackage
1169
+ py -m pip install --extra-index-url http://my.package.repo/simple SomePackage
1161
1170
1162
1171
1163
1172
#. Find pre-release and development versions, in addition to stable versions. By default, pip only finds stable versions.
0 commit comments