@@ -188,7 +188,7 @@ Now that you're in your virtual environment you can install packages. Let's inst
188188
189189.. code-block :: bash
190190
191- pip install requests
191+ python3 -m pip install requests
192192
193193 pip should download requests and all of its dependencies and install them:
194194
@@ -219,19 +219,19 @@ a specific version of ``requests``:
219219
220220.. code-block :: bash
221221
222- pip install requests==2.18.4
222+ python3 -m pip install requests==2.18.4
223223
224224 To install the latest ``2.x `` release of requests:
225225
226226.. code-block :: bash
227227
228- pip install requests> =2.0.0,< 3.0.0
228+ python3 -m pip install requests> =2.0.0,< 3.0.0
229229
230230 To install pre-release versions of packages, use the ``--pre `` flag:
231231
232232.. code-block :: bash
233233
234- pip install --pre requests
234+ python3 -m pip install --pre requests
235235
236236
237237 Installing extras
@@ -242,7 +242,7 @@ specifying the extra in brackets:
242242
243243.. code-block :: bash
244244
245- pip install requests[security]
245+ python3 -m pip install requests[security]
246246
247247 .. _extras :
248248 https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies
@@ -256,15 +256,15 @@ pip can install a package directly from source, for example:
256256.. code-block :: bash
257257
258258 cd google-auth
259- pip install .
259+ python3 -m pip install .
260260
261261 Additionally, pip can install packages from source in `development mode `_,
262262meaning that changes to the source directory will immediately affect the
263263installed package without needing to re-install:
264264
265265.. code-block :: bash
266266
267- pip install --editable .
267+ python3 -m pip install --editable .
268268
269269
270270 .. _development mode :
@@ -293,15 +293,15 @@ wheel, or tar file) you can install it directly with pip:
293293
294294.. code-block :: bash
295295
296- pip install requests-2.18.4.tar.gz
296+ python3 -m pip install requests-2.18.4.tar.gz
297297
298298 If you have a directory containing archives of multiple packages, you can tell
299299pip to look for packages there and not to use the
300300:term: `Python Package Index (PyPI) ` at all:
301301
302302.. code-block :: bash
303303
304- pip install --no-index --find-links=/local/dir/ requests
304+ python3 -m pip install --no-index --find-links=/local/dir/ requests
305305
306306 This is useful if you are installing packages on a system with limited
307307connectivity or if you want to strictly control the origin of distribution
@@ -316,15 +316,15 @@ If you want to download packages from a different index than the
316316
317317.. code-block :: bash
318318
319- pip install --index-url http://index.example.com/simple/ SomeProject
319+ python3 -m pip install --index-url http://index.example.com/simple/ SomeProject
320320
321321 If you want to allow packages from both the :term: `Python Package Index (PyPI) `
322322and a separate index, you can use the ``--extra-index-url `` flag instead:
323323
324324
325325.. code-block :: bash
326326
327- pip install --extra-index-url http://index.example.com/simple/ SomeProject
327+ python3 -m pip install --extra-index-url http://index.example.com/simple/ SomeProject
328328
329329
330330 Upgrading packages
@@ -335,7 +335,7 @@ install the latest version of ``requests`` and all of its dependencies:
335335
336336.. code-block :: bash
337337
338- pip install --upgrade requests
338+ python3 -m pip install --upgrade requests
339339
340340
341341 Using requirements files
@@ -354,7 +354,7 @@ And tell pip to install all of the packages in this file using the ``-r`` flag:
354354
355355.. code-block :: bash
356356
357- pip install -r requirements.txt
357+ python3 -m pip install -r requirements.txt
358358
359359
360360 Freezing dependencies
@@ -365,7 +365,7 @@ Pip can export a list of all installed packages and their versions using the
365365
366366.. code-block :: bash
367367
368- pip freeze
368+ python3 -m pip freeze
369369
370370 Which will output a list of package specifiers such as:
371371
0 commit comments