-
Notifications
You must be signed in to change notification settings - Fork 0
/
pip commands list.pip
747 lines (478 loc) · 28.2 KB
/
pip commands list.pip
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
https://pip.pypa.io/en/stable/cli/pip_list/
List installed packages (with the default column formatting).
py -m pip list
List outdated packages with column formatting.
py -m pip list --outdated --format columns
List packages that are not dependencies of other packages. Can be combined with other options.
py -m pip list --outdated --not-required
Use json formatting
py -m pip list --format=json
Use freeze formatting
py -m pip list --format=freeze
List packages installed in editable mode
py -m pip list
Installation Order
py -m pip install quux
py -m pip install bar
Options
-r, --requirement <file>
Install from the given requirements file. This option can be used multiple times.
-c, --constraint <file>
Constrain versions using the given constraints file. This option can be used multiple times.
--no-deps
Don?t install package dependencies.
--pre
Include pre-release and development versions. By default, pip only finds stable versions.
-e, --editable <path/url>
Install a project in editable mode (i.e. setuptools ?develop mode?) from a local project path or a VCS url.
--dry-run
Don?t actually install anything, just print what would be. Can be used in combination with --ignore-installed to ?resolve? the requirements.
-t, --target <dir>
Install packages into <dir>. By default this will not replace existing files/folders in <dir>. Use --upgrade to replace existing packages in <dir> with new versions.
--platform <platform>
Only use wheels compatible with <platform>. Defaults to the platform of the running system. Use this option multiple times to specify multiple platforms supported by the target interpreter.
--python-version <python_version>
The Python interpreter version to use for wheel and ?Requires-Python? compatibility checks. Defaults to a version derived from the running interpreter. The version can be specified using up to three dot-separated integers (e.g. ?3? for 3.0.0, ?3.7? for 3.7.0, or ?3.7.3?). A major-minor version can also be given as a string without dots (e.g. ?37? for 3.7.0).
--implementation <implementation>
Only use wheels compatible with Python implementation <implementation>, e.g. ?pp?, ?jy?, ?cp?, or ?ip?. If not specified, then the current interpreter implementation is used. Use ?py? to force implementation-agnostic wheels.
--abi <abi>
Only use wheels compatible with Python abi <abi>, e.g. ?pypy_41?. If not specified, then the current interpreter abi tag is used. Use this option multiple times to specify multiple abis supported by the target interpreter. Generally you will need to specify --implementation, --platform, and --python-version when using this option.
--user
Install to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%Python on Windows. (See the Python documentation for site.USER_BASE for full details.)
--root <dir>
Install everything relative to this alternate root directory.
--prefix <dir>
Installation prefix where lib, bin and other top-level folders are placed. Note that the resulting installation may contain scripts and other resources which reference the Python interpreter of pip, and not that of --prefix. See also the --python option if the intention is to install packages into another (possibly pip-free) environment.
--src <dir>
Directory to check out editable projects into. The default in a virtualenv is ?<venv path>/src?. The default for global installs is ?<current dir>/src?.
-U, --upgrade
Upgrade all specified packages to the newest available version. The handling of dependencies depends on the upgrade-strategy used.
--upgrade-strategy <upgrade_strategy>
Determines how dependency upgrading should be handled [default: only-if-needed]. ?eager? - dependencies are upgraded regardless of whether the currently installed version satisfies the requirements of the upgraded package(s). ?only-if-needed? - are upgraded only when they do not satisfy the requirements of the upgraded package(s).
--force-reinstall
Reinstall all packages even if they are already up-to-date.
-I, --ignore-installed
Ignore the installed packages, overwriting them. This can break your system if the existing package is of a different version or was installed with a different package manager!
--ignore-requires-python
Ignore the Requires-Python information.
--no-build-isolation
Disable isolation when building a modern source distribution. Build dependencies specified by PEP 518 must be already installed if this option is used.
--use-pep517
Use PEP 517 for building source distributions (use --no-use-pep517 to force legacy behaviour).
--check-build-dependencies
Check the build dependencies when PEP517 is used.
--break-system-packages
Allow pip to modify an EXTERNALLY-MANAGED Python installation
-C, --config-settings <settings>
Configuration settings to be passed to the PEP 517 build backend. Settings take the form KEY=VALUE. Use multiple --config-settings options to pass multiple keys to the backend.
--global-option <options>
Extra global options to be supplied to the setup.py call before the install or bdist_wheel command.
--compile
Compile Python source files to bytecode
--no-compile
Do not compile Python source files to bytecode
--no-warn-script-location
Do not warn when installing scripts outside PATH
--no-warn-conflicts
Do not warn about broken dependencies
--no-binary <format_control>
Do not use binary packages. Can be supplied multiple times, and each time adds to the existing value. Accepts either ?:all:? to disable all binary packages, ?:none:? to empty the set (notice the colons), or one or more package names with commas between them (no colons). Note that some packages are tricky to compile and may fail to install when this option is used on them.
--only-binary <format_control>
Do not use source packages. Can be supplied multiple times, and each time adds to the existing value. Accepts either ?:all:? to disable all source packages, ?:none:? to empty the set, or one or more package names with commas between them. Packages without binary distributions will fail to install when this option is used on them.
--prefer-binary
Prefer binary packages over source packages, even if the source packages are newer.
--require-hashes
Require a hash to check each requirement against, for repeatable installs. This option is implied when any package in a requirements file has a --hash option.
--progress-bar <progress_bar>
Specify whether the progress bar should be used [on, off] (default: on)
--root-user-action <root_user_action>
Action if pip is run as a root user. By default, a warning message is shown.
--report <file>
Generate a JSON file describing what pip did to install the provided requirements. Can be used in combination with --dry-run and --ignore-installed to ?resolve? the requirements. When - is used as file name it writes to stdout. When writing to stdout, please combine with the --quiet option to avoid mixing pip logging output with JSON output.
--no-clean
Don?t clean up build directories.
-i, --index-url <url>
Base URL of the Python Package Index (default https://pypi.org/simple). This should point to a repository compliant with PEP 503 (the simple repository API) or a local directory laid out in the same format.
--extra-index-url <url>
Extra URLs of package indexes to use in addition to --index-url. Should follow the same rules as --index-url.
--no-index
Ignore package index (only looking at --find-links URLs instead).
-f, --find-links <url>
If a URL or path to an html file, then parse for links to archives such as sdist (.tar.gz) or wheel (.whl) files. If a local path or file:// URL that?s a directory, then look for archives in the directory listing. Links to VCS project URLs are not supported.
Examples
py -m pip install SomePackage # latest version
py -m pip install "SomePackage==1.0.4" # specific version
py -m pip install "SomePackage>=1.0.4" # minimum version
Install a list of requirements specified in a file. See the Requirements files.
https://pip.pypa.io/en/stable/user_guide/#requirements-files
py -m pip install -r requirements.txt
Upgrade an already installed SomePackage to the latest from PyPI.
py -m pip install --upgrade SomePackage
Install a local project in ?editable? mode. See the section on Editable Installs.
py -m pip install -e . # project in current directory
py -m pip install -e path/to/project # project in another directory
Install a project from VCS
py -m pip install "SomeProject@git+https://git.repo/[email protected]"
Install a project from VCS in ?editable? mode. See the sections on VCS Support and Editable Installs.
py -m pip install -e "git+https://git.repo/some_pkg.git#egg=SomePackage" # from git
py -m pip install -e "hg+https://hg.repo/some_pkg.git#egg=SomePackage" # from mercurial
py -m pip install -e "svn+svn://svn.repo/some_pkg/trunk/#egg=SomePackage" # from svn
py -m pip install -e "git+https://git.repo/some_pkg.git@feature#egg=SomePackage" # from 'feature' branch
py -m pip install -e "git+https://git.repo/some_repo.git#egg=subdir&subdirectory=subdir_path" # install a python package from a repo subdirectory
Install a package with extras.
py -m pip install "SomePackage[PDF]"
py -m pip install "SomePackage[PDF] @ git+https://git.repo/SomePackage@main#subdirectory=subdir_path"
py -m pip install ".[PDF]" # project in current directory
py -m pip install "SomePackage[PDF]==3.0"
py -m pip install "SomePackage[PDF,EPUB]" # multiple extras
Install a particular source archive file.
py -m pip install "./downloads/SomePackage-1.0.4.tar.gz"
py -m pip install "http://my.package.repo/SomePackage-1.0.4.zip"
Install a particular source archive file following PEP 440 direct references.
py -m pip install "SomeProject@http://my.package.repo/SomeProject-1.2.3-py33-none-any.whl"
py -m pip install "SomeProject @ http://my.package.repo/SomeProject-1.2.3-py33-none-any.whl"
py -m pip install "SomeProject@http://my.package.repo/1.2.3.tar.gz"
Install from alternative package repositories.
py -m pip install --index-url http://my.package.repo/simple/ SomePackage
Install from a local flat directory containing archives (and don?t scan indexes):
py -m pip install --no-index --find-links=file:///local/dir/ SomePackage
py -m pip install --no-index --find-links=/local/dir/ SomePackage
py -m pip install --no-index --find-links=relative/dir/ SomePackage
Find pre-release and development versions, in addition to stable versions. By default, pip only finds stable versions.
py -m pip install --pre SomePackage
Install packages from source.
py -m pip install SomePackage1 SomePackage2 --no-binary :all:
py -m pip install SomePackage1 SomePackage2 --no-binary SomePackage1
pip uninstall
python -m pip uninstall [options] <package> ...
python -m pip uninstall [options] -r <requirements file> ...
Options
-r, --requirement <file>
Uninstall all the packages listed in the given requirements file. This option can be used multiple times.
-y, --yes
Don?t ask for confirmation of uninstall deletions.
--root-user-action <root_user_action>
Action if pip is run as a root user. By default, a warning message is shown.
--break-system-packages
Allow pip to modify an EXTERNALLY-MANAGED Python installation
Uninstall a package.
python -m pip uninstall simplejson
Uninstalling simplejson:
/home/me/env/lib/python3.9/site-packages/simplejson
/home/me/env/lib/python3.9/site-packages/simplejson-2.2.1-py3.9.egg-info
Proceed (Y/n)? y
Successfully uninstalled simplejson
pip inspect
py -m pip inspect [options]
Options
--local
If in a virtualenv that has global access, do not list globally-installed packages.
--user
Only output packages installed in user-site.
--path <path>
Restrict to the specified installation path for listing packages (can be used multiple times).
pip list
py -m pip list [options]
Options
-o, --outdated
List outdated packages
-u, --uptodate
List uptodate packages
-e, --editable
List editable projects.
-l, --local
If in a virtualenv that has global access, do not list globally-installed packages.
--user
Only output packages installed in user-site.
--path <path>
Restrict to the specified installation path for listing packages (can be used multiple times).
--pre
Include pre-release and development versions. By default, pip only finds stable versions.
--format <list_format>
Select the output format among: columns (default), freeze, or json. The ?freeze? format cannot be used with the --outdated option.
--not-required
List packages that are not dependencies of installed packages.
--exclude-editable
Exclude editable package from output.
--include-editable
Include editable package from output.
--exclude <package>
Exclude specified package from the output
-i, --index-url <url>
Base URL of the Python Package Index (default https://pypi.org/simple). This should point to a repository compliant with PEP 503 (the simple repository API) or a local directory laid out in the same format.
--extra-index-url <url>
Extra URLs of package indexes to use in addition to --index-url. Should follow the same rules as --index-url.
--no-index
Ignore package index (only looking at --find-links URLs instead).
-f, --find-links <url>
If a URL or path to an html file, then parse for links to archives such as sdist (.tar.gz) or wheel (.whl) files. If a local path or file:// URL that?s a directory, then look for archives in the directory listing. Links to VCS project URLs are not supported.
List installed packages (with the default column formatting).
py -m pip list
List outdated packages with column formatting.
py -m pip list --outdated --format columns
List packages that are not dependencies of other packages. Can be combined with other options.
py -m pip list --outdated --not-required
Use json formatting
py -m pip list --format=json
Use freeze formatting
py -m pip list --format=freeze
List packages installed in editable mode
py -m pip list
pip show
py -m pip show [options] <package> ...
Options
-f, --files
Show the full list of installed files for each package.
Show information about a package:
py -m pip show sphinx
Show all information about a package
py -m pip show --verbose sphinx
pip freeze
py -m pip freeze [options]
Options
-r, --requirement <file>
Use the order in the given requirements file and its comments when generating output. This option can be used multiple times.
-l, --local
If in a virtualenv that has global access, do not output globally-installed packages.
--user
Only output packages installed in user-site.
--path <path>
Restrict to the specified installation path for listing packages (can be used multiple times).
--all
Do not skip these packages in the output: pip, distribute, setuptools, wheel
--exclude-editable
Exclude editable package from output.
--exclude <package>
Exclude specified package from the output
Generate output suitable for a requirements file.
py -m pip freeze
Generate a requirements file and then install from it in another environment.
env1\bin\python -m pip freeze > requirements.txt
env2\bin\python -m pip install -r requirements.txt
pip check
py -m pip check [options]
If all dependencies are compatible:
py -m pip check
If a package is missing:
py -m pip check
If a package has the wrong version:
py -m pip check
pip download
py -m pip download [options] <requirement specifier> [package-index-options] ...
py -m pip download [options] -r <requirements file> [package-index-options] ...
py -m pip download [options] <vcs project url> ...
py -m pip download [options] <local project path> ...
py -m pip download [options] <archive url/path> ...
Options
-c, --constraint <file>
Constrain versions using the given constraints file. This option can be used multiple times.
-r, --requirement <file>
Install from the given requirements file. This option can be used multiple times.
--no-deps
Don?t install package dependencies.
--global-option <options>
Extra global options to be supplied to the setup.py call before the install or bdist_wheel command.
--no-binary <format_control>
Do not use binary packages. Can be supplied multiple times, and each time adds to the existing value. Accepts either ?:all:? to disable all binary packages, ?:none:? to empty the set (notice the colons), or one or more package names with commas between them (no colons). Note that some packages are tricky to compile and may fail to install when this option is used on them.
--only-binary <format_control>
Do not use source packages. Can be supplied multiple times, and each time adds to the existing value. Accepts either ?:all:? to disable all source packages, ?:none:? to empty the set, or one or more package names with commas between them. Packages without binary distributions will fail to install when this option is used on them.
--prefer-binary
Prefer binary packages over source packages, even if the source packages are newer.
--src <dir>
Directory to check out editable projects into. The default in a virtualenv is ?<venv path>/src?. The default for global installs is ?<current dir>/src?.
--pre
Include pre-release and development versions. By default, pip only finds stable versions.
--require-hashes
Require a hash to check each requirement against, for repeatable installs. This option is implied when any package in a requirements file has a --hash option.
--progress-bar <progress_bar>
Specify whether the progress bar should be used [on, off] (default: on)
--no-build-isolation
Disable isolation when building a modern source distribution. Build dependencies specified by PEP 518 must be already installed if this option is used.
--use-pep517
Use PEP 517 for building source distributions (use --no-use-pep517 to force legacy behaviour).
--check-build-dependencies
Check the build dependencies when PEP517 is used.
--ignore-requires-python
Ignore the Requires-Python information.
-d, --dest <dir>
Download packages into <dir>.
--platform <platform>
Only use wheels compatible with <platform>. Defaults to the platform of the running system. Use this option multiple times to specify multiple platforms supported by the target interpreter.
--python-version <python_version>
The Python interpreter version to use for wheel and ?Requires-Python? compatibility checks. Defaults to a version derived from the running interpreter. The version can be specified using up to three dot-separated integers (e.g. ?3? for 3.0.0, ?3.7? for 3.7.0, or ?3.7.3?). A major-minor version can also be given as a string without dots (e.g. ?37? for 3.7.0).
--implementation <implementation>
Only use wheels compatible with Python implementation <implementation>, e.g. ?pp?, ?jy?, ?cp?, or ?ip?. If not specified, then the current interpreter implementation is used. Use ?py? to force implementation-agnostic wheels.
--abi <abi>
Only use wheels compatible with Python abi <abi>, e.g. ?pypy_41?. If not specified, then the current interpreter abi tag is used. Use this option multiple times to specify multiple abis supported by the target interpreter. Generally you will need to specify --implementation, --platform, and --python-version when using this option.
--no-clean
Don?t clean up build directories.
-i, --index-url <url>
Base URL of the Python Package Index (default https://pypi.org/simple). This should point to a repository compliant with PEP 503 (the simple repository API) or a local directory laid out in the same format.
--extra-index-url <url>
Extra URLs of package indexes to use in addition to --index-url. Should follow the same rules as --index-url.
--no-index
Ignore package index (only looking at --find-links URLs instead).
-f, --find-links <url>
If a URL or path to an html file, then parse for links to archives such as sdist (.tar.gz) or wheel (.whl) files. If a local path or file:// URL that?s a directory, then look for archives in the directory listing. Links to VCS project URLs are not supported.
Download a package and all of its dependencies
py -m pip download SomePackage
py -m pip download -d . SomePackage # equivalent to above
py -m pip download --no-index --find-links=/tmp/wheelhouse -d /tmp/otherwheelhouse SomePackage
Download a package and all of its dependencies with OSX specific interpreter constraints. This forces OSX 10.10 or lower compatibility. Since OSX deps are forward compatible, this will also match macosx_10_9_x86_64, macosx_10_8_x86_64, macosx_10_8_intel, etc. It will also match deps with platform any. Also force the interpreter version to 27 (or more generic, i.e. 2) and implementation to cp (or more generic, i.e. py).
py -m pip download ^
--only-binary=:all: ^
--platform macosx_10_10_x86_64 ^
--python-version 27 ^
--implementation cp ^
SomePackage
Download a package and its dependencies with linux specific constraints. Force the interpreter to be any minor version of py3k, and only accept cp34m or none as the abi.
py -m pip download ^
--only-binary=:all: ^
--platform linux_x86_64 ^
--python-version 3 ^
--implementation cp ^
--abi cp34m ^
SomePackage
Force platform, implementation, and abi agnostic deps.
py -m pip download ^
--only-binary=:all: ^
--platform any ^
--python-version 3 ^
--implementation py ^
--abi none ^
SomePackage
Even when overconstrained, this will still correctly fetch the pip universal wheel.
py -m pip download ^
--only-binary=:all: ^
--platform linux_x86_64 ^
--python-version 33 ^
--implementation cp ^
--abi cp34m ^
pip>=8
Download a package supporting one of several ABIs and platforms.
py -m pip download ^
--only-binary=:all: ^
--platform manylinux1_x86_64 --platform linux_x86_64 --platform any ^
--python-version 36 ^
--implementation cp ^
--abi cp36m --abi cp36 --abi abi3 --abi none ^
SomePackage
pip wheel
py -m pip wheel [options] <requirement specifier> ...
py -m pip wheel [options] -r <requirements file> ...
py -m pip wheel [options] [-e] <vcs project url> ...
py -m pip wheel [options] [-e] <local project path> ...
py -m pip wheel [options] <archive url/path> ...
Options
-w, --wheel-dir <dir>
Build wheels into <dir>, where the default is the current working directory.
--no-binary <format_control>
Do not use binary packages. Can be supplied multiple times, and each time adds to the existing value. Accepts either ?:all:? to disable all binary packages, ?:none:? to empty the set (notice the colons), or one or more package names with commas between them (no colons). Note that some packages are tricky to compile and may fail to install when this option is used on them.
--only-binary <format_control>
Do not use source packages. Can be supplied multiple times, and each time adds to the existing value. Accepts either ?:all:? to disable all source packages, ?:none:? to empty the set, or one or more package names with commas between them. Packages without binary distributions will fail to install when this option is used on them.
--prefer-binary
Prefer binary packages over source packages, even if the source packages are newer.
--no-build-isolation
Disable isolation when building a modern source distribution. Build dependencies specified by PEP 518 must be already installed if this option is used.
--use-pep517
Use PEP 517 for building source distributions (use --no-use-pep517 to force legacy behaviour).
--check-build-dependencies
Check the build dependencies when PEP517 is used.
-c, --constraint <file>
Constrain versions using the given constraints file. This option can be used multiple times.
-e, --editable <path/url>
Install a project in editable mode (i.e. setuptools ?develop mode?) from a local project path or a VCS url.
-r, --requirement <file>
Install from the given requirements file. This option can be used multiple times.
--src <dir>
Directory to check out editable projects into. The default in a virtualenv is ?<venv path>/src?. The default for global installs is ?<current dir>/src?.
--ignore-requires-python
Ignore the Requires-Python information.
--no-deps
Don?t install package dependencies.
--progress-bar <progress_bar>
Specify whether the progress bar should be used [on, off] (default: on)
--no-verify
Don?t verify if built wheel is valid.
-C, --config-settings <settings>
Configuration settings to be passed to the PEP 517 build backend. Settings take the form KEY=VALUE. Use multiple --config-settings options to pass multiple keys to the backend.
--build-option <options>
Extra arguments to be supplied to ?setup.py bdist_wheel?.
--global-option <options>
Extra global options to be supplied to the setup.py call before the install or bdist_wheel command.
--pre
Include pre-release and development versions. By default, pip only finds stable versions.
--require-hashes
Require a hash to check each requirement against, for repeatable installs. This option is implied when any package in a requirements file has a --hash option.
--no-clean
Don?t clean up build directories.
-i, --index-url <url>
Base URL of the Python Package Index (default https://pypi.org/simple). This should point to a repository compliant with PEP 503 (the simple repository API) or a local directory laid out in the same format.
--extra-index-url <url>
Extra URLs of package indexes to use in addition to --index-url. Should follow the same rules as --index-url.
--no-index
Ignore package index (only looking at --find-links URLs instead).
-f, --find-links <url>
If a URL or path to an html file, then parse for links to archives such as sdist (.tar.gz) or wheel (.whl) files. If a local path or file:// URL that?s a directory, then look for archives in the directory listing. Links to VCS project URLs are not supported.
Build wheels for a requirement (and all its dependencies), and then install
py -m pip wheel --wheel-dir=/tmp/wheelhouse SomePackage
py -m pip install --no-index --find-links=/tmp/wheelhouse SomePackage
Build a wheel for a package from source
py -m pip wheel --no-binary SomePackage SomePackage
pip hash
py -m pip hash [options] <file> ...
Options
-a, --algorithm <algorithm>
The hash algorithm to use: one of sha256, sha384, sha512
Compute the hash of a downloaded archive:
py -m pip download SomePackage
Collecting SomePackage
Downloading SomePackage-2.2.tar.gz
Saved ./pip_downloads/SomePackage-2.2.tar.gz
Successfully downloaded SomePackage
py -m pip hash ./pip_downloads/SomePackage-2.2.tar.gz
./pip_downloads/SomePackage-2.2.tar.gz:
--hash=sha256:93e62e05c7ad3da1a233def6731e8285156701e3419a5fe279017c429ec67ce0
pip search
py -m pip search [options] <query>
Options
-i, --index <url>
Base URL of Python Package Index (default https://pypi.org/pypi)
Search for ?peppercorn?
py -m pip search peppercorn
pip cache
py -m pip cache dir
py -m pip cache info
py -m pip cache list [<pattern>] [--format=[human, abspath]]
py -m pip cache remove <pattern>
py -m pip cache purge
Options
--format <list_format>
Select the output format among: human (default) or abspath
pip config
py -m pip config [<file-option>] list
py -m pip config [<file-option>] [--editor <editor-path>] edit
py -m pip config [<file-option>] get command.option
py -m pip config [<file-option>] set command.option value
py -m pip config [<file-option>] unset command.option
py -m pip config [<file-option>] debug
Options
--editor <editor>
Editor to use to edit the file. Uses VISUAL or EDITOR environment variables if not provided.
--global
Use the system-wide configuration file only
--user
Use the user configuration file only
--site
Use the current environment configuration file only
pip debug
py -m pip debug <options>
Options
--platform <platform>
Only use wheels compatible with <platform>. Defaults to the platform of the running system. Use this option multiple times to specify multiple platforms supported by the target interpreter.
--python-version <python_version>
The Python interpreter version to use for wheel and ?Requires-Python? compatibility checks. Defaults to a version derived from the running interpreter. The version can be specified using up to three dot-separated integers (e.g. ?3? for 3.0.0, ?3.7? for 3.7.0, or ?3.7.3?). A major-minor version can also be given as a string without dots (e.g. ?37? for 3.7.0).
--implementation <implementation>
Only use wheels compatible with Python implementation <implementation>, e.g. ?pp?, ?jy?, ?cp?, or ?ip?. If not specified, then the current interpreter implementation is used. Use ?py? to force implementation-agnostic wheels.
--abi <abi>
Only use wheels compatible with Python abi <abi>, e.g. ?pypy_41?. If not specified, then the current interpreter abi tag is used. Use this option multiple times to specify multiple abis supported by the target interpreter. Generally you will need to specify --implementation, --platform, and --python-version when using this option.