generated from nexB/skeleton
/
pip-docs-examples.txt
81 lines (52 loc) · 2.96 KB
/
pip-docs-examples.txt
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
# examples from https://pip.pypa.io/en/stable/reference/requirements-file-format/
# Install SomePackage and its dependencies from PyPI using Requirement
SomePackage # latest version
SomePackage==1.0.4 # specific version
SomePackage>=1.0.4 # minimum version
# Install a list of requirements specified in a file. See the Requirements files.
-r requirements.txt
# Install a local project in "editable" mode. See the section on Editable Installs.
-e . # project in current directory
-e path/to/project # project in another directory
# Install a project from VCS
SomeProject@git+https://git.repo/some_pkg.git@1.3.1
# Install a project from VCS in "editable" mode. See the sections on VCS Support and Editable Installs.
-e git+https://git.repo/some_pkg.git#egg=SomePackage # from git
-e hg+https://hg.repo/some_pkg.git#egg=SomePackage # from mercurial
-e svn+svn://svn.repo/some_pkg/trunk/#egg=SomePackage # from svn
-e git+https://git.repo/some_pkg.git@feature#egg=SomePackage # from 'feature' branch
-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 setuptools extras.
SomePackage[PDF]
SomePackage[PDF] @ git+https://git.repo/SomePackage@main#subdirectory=subdir_path
.[PDF] # project in current directory
SomePackage[PDF]==3.0
SomePackage[PDF,EPUB] # multiple extras
# Install a particular source archive file.
./downloads/SomePackage-1.0.4.tar.gz
http://my.package.repo/SomePackage-1.0.4.zip
# Install a particular source archive file following PEP 440 direct references.
SomeProject@http://my.package.repo/SomeProject-1.2.3-py33-none-any.whl
SomeProject @ http://my.package.repo/SomeProject-1.2.3-py33-none-any.whl
SomeProject@http://my.package.repo/1.2.3.tar.gz
# Install from alternative package repositories.
# Install from a different index, and not PyPI
--index-url http://my.package.repo/simple/ SomePackage
# Install from a local flat directory containing archives (and don't scan indexes):
--no-index --find-links=file:///local/dir/ SomePackage
--no-index --find-links=/local/dir/ SomePackage
--no-index --find-links=relative/dir/ SomePackage
# Search an additional index during install, in addition to PyPI
# Using this option to search for packages which are not in the main repository
# (such as private packages) is unsafe, per a security vulnerability called
# dependency confusion: an attacker can claim the package on the public repository
# in a way that will ensure it gets chosen over the private package.
--extra-index-url http://my.package.repo/simple SomePackage
# Find pre-release and development versions, in addition to stable versions.
# By default, pip only finds stable versions.
--pre SomePackage
# Install packages from source.
# Do not use any binary packages
SomePackage1 SomePackage2 --no-binary :all:
# Specify SomePackage1 to be installed from source:
SomePackage1 SomePackage2 --no-binary SomePackage1