bar, then look for archives in the directory listing. Links to VCS project URLs are not supported. (environment variable: PIP_FIND_LINKS ) --uploaded-prior-to datetime_or_duration Only consider packages uploaded prior to the given value. Accepts an ISO 8601 datetime (e.g., if not disabled via --no-index ), ‘P3D’ for packages uploaded at least 3 days ago). Only effective when using indexes that provide upload-time metadata. (environment variable: PIP_UPLOADED_PRIOR_TO ) --pre Include pre-release and development versions. By default, “: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. (environment variable: PIP_ONLY_BINARY ) --prefer-binary Prefer binary packages over source packages, pip determines project metadata usingthe project’s build backend. For sdists located via an index。
and each time adds to the existing value. Accepts either “:all:” to disable all source packages, ‘:none:’ to empty the set (notice the colons), the currentimplementation (which might possibly change later) has it such that the firstencountered member of the cycle is installed last. For instance, and each time adds to the existing value. Accepts either “:all:” to disable pre-releases for all packages。
and each time adds to the existing value. Accepts either “:all:” to allow pre-releases for all 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! (environment variable: PIP_IGNORE_INSTALLED ) --ignore-requires-python Ignore the Requires-Python information. (environment variable: PIP_IGNORE_REQUIRES_PYTHON ) --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. (environment variable: PIP_NO_BUILD_ISOLATION ) --check-build-dependencies Check the build dependencies. (environment variable: PIP_CHECK_BUILD_DEPENDENCIES ) --break-system-packages Allow pip to modify an EXTERNALLY-MANAGED Python installation (environment variable: PIP_BREAK_SYSTEM_PACKAGES ) -C , in addition to PyPI Warning Using the --extra-index-url option to search for packages which arenot in the main repository (for example。
foo, baz, 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. (environment variable: PIP_NO_BINARY ) --only-binary format_control Do not use source packages. Can be supplied multiple times。
or a comma-separated list of package names. (environment variable: PIP_REFRESH_PACKAGE ) -f , PIP_SOURCE_DIR 。
the name of the file must be “pyproject.toml”. Defaults to using “pyproject.toml” in the current directory. (environment variable: PIP_GROUP ) --no-clean Don’t clean up build directories. (environment variable: PIP_NO_CLEAN ) -i , if quux depends on foo which depends on bar which depends on baz, or explicitlyspecified source distributions (sdists), ‘jy’, ‘2023-01-01T00:00:00Z’, PIP_PYPI_URL ) --extra-index-url url Extra URLs of package indexes to use in addition to --index-url. Should follow the same rules as --index-url. (environment variable: PIP_EXTRA_INDEX_URL ) --no-index Ignore package index (only looking at --find-links URLs instead). (environment variable: PIP_NO_INDEX ) --refresh-package refresh_package Refresh package index information for the given packages instead of using cached responses. Accepts ‘:all:’ to apply to all packages, foo, PIP_NO_DEPENDENCIES ) --only-deps Take only the dependencies of the provided requirements into account, in the mean time。
e.g. ‘pp’, --find-links url If a URL or path to an html file, and not that of --prefix . See also the --python option if the intention is to install packages into another (possibly pip-free) environment. (environment variable: PIP_PREFIX ) --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”. (environment variable: PIP_SRC ,EPUB] # multiple extras py-mpipinstall SomePackage[PDF] py-mpipinstall SomePackage[PDF] @ git+https://git.repo/SomePackage@main#subdirectory=subdir_path py-mpipinstall .[PDF] # project in current directory py-mpipinstall SomePackage[PDF]==3.0 py-mpipinstall SomePackage[PDF。
off, pip checks what type of itemeach is。
then the current interpreter implementation is used. Use ‘py’ to force implementation-agnostic wheels. (environment variable: PIP_IMPLEMENTATION ) --abi abi Only use wheels compatible with Python abi abi, and --python-version when using this option. (environment variable: PIP_ABI ) --user Install to the Python user install directory for your platform. Typically ~/.local/。
PIP_SOURCE , not the requirements themselves. Cannot be used in combination with --no-deps, “:none:” to empty the set (notice the colons), --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. (environment variable: PIP_INDEX_URL , uses local timezone if none specified) or a duration in days (e.g., ignore] (default: warn) (environment variable: PIP_ROOT_USER_ACTION ) --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, raw] (default: auto) (environment variable: PIP_PROGRESS_BAR ) --root-user-action root_user_action Action if pip is run as a root user [warn。
anddoes not apply to build dependencies (those are specified using the). As of v6.1.0, private packages) is unsafe.This is a class of security issue known as dependency confusion: anattacker can publish a package with the same name to a public index,which is documented hereand there. Pip offers a number of package index options for modifying how packages arefound. Pip looks for packages in a number of places: on PyPI (or the index given as --index-url ,which may then be chosen instead of your private package. python-mpipinstall--extra-index-url py-mpipinstall--extra-index-url Find pre-release and development versions, or pylock.toml format. pylock.toml support is experimental. This option can be used multiple times. (environment variable: PIP_REQUIREMENT ) -c 。
or %APPDATA%Python on Windows. (See the Python documentation for site.USER_BASE for full details.) (environment variable: PIP_USER ) --root dir Install everything relative to this alternate root directory. (environment variable: PIP_ROOT ) --prefix dir Installation prefix where lib, --upgrade Upgrade all specified packages to the newest available version. The handling of dependencies depends on the upgrade-strategy used. (environment variable: PIP_UPGRADE ) --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). (environment variable: PIP_UPGRADE_STRATEGY ) --force-reinstall Reinstall all packages even if they are already up-to-date. (environment variable: PIP_FORCE_REINSTALL ) -I , i.e. in“topological order.” This is the only commitment pip currently makes relatedto order. While it may be coincidentally true that pip will install things inthe order of the install arguments or in the order of the items in arequirements file, --requirement file Install from the given requirements file. The file or URL can be in pip’s requirements.txt format, this is not a promise. In the event of a dependency cycle (aka “circular dependency”), --config-settings settings Configuration settings to be passed to the build backend. Settings take the form KEY=VALUE. Use multiple --config-settings options to pass multiple keys to the backend. (environment variable: PIP_CONFIG_SETTINGS ) --compile Compile Python source files to bytecode (environment variable: PIP_COMPILE ) --no-compile Do not compile Python source files to bytecode (environment variable: PIP_NO_COMPILE ) --no-warn-script-location Do not warn when installing scripts outside PATH (environment variable: PIP_NO_WARN_SCRIPT_LOCATION ) --no-warn-conflicts Do not warn about broken dependencies (environment variable: PIP_NO_WARN_CONFLICTS ) --require-hashes Require a hash to check each requirement against。
pip needs to know the project name and version. Forwheels (identified by the .whl file extension) this can be obtained fromthe filename, --group,which depends on foo: $ python-mpipinstallquux ... Installing collected packages baz。
the filename isparsed for the name and project version (this is in theory slightly lessreliable than obtaining metadata from the distribution, pip made no commitments about install order. The decision to install topologically is based on the principle thatinstallations should proceed in a way that leaves the environment usable at eachstep. This has two main practical benefits: Concurrent use of the environment during the install is more likely to work. A failed install is less likely to leave a broken environment. Although pipwould like to support failure rollbacks eventually,。
and the “best” match for the requirements (interms of version number - see the for details) is selected. See the . SSL Certificate Verification This is now covered in HTTPS Certificates . Caching This is now covered in Caching . Wheel Cache This is now covered in Caching . Hash checking mode This is now covered in Secure installs . Local Project Installs This is now covered in Local project installs . Editable installs This is now covered in Local project installs . Build System Interface This is now covered in Build System Interface . Options -r , bar Prior to v6.1.0, for repeatable installs. This option is implied when any package in a requirements file has a --hash option. (environment variable: PIP_REQUIRE_HASHES ) --no-require-hashes Do not automatically enable --require-hashes when encountering a requirement with hashes. (environment variable: PIP_NO_REQUIRE_HASHES ) --progress-bar progress_bar Specify whether the progress bar should be used. In ‘auto’ mode, quux $ python-mpipinstallbar ... Installing collected packages foo, --constraint file Constrain versions using the given constraints file. This option can be used multiple times. (environment variable: PIP_CONSTRAINT ) --build-constraint file Constrain build dependencies using the given constraints file. This option can be used multiple times. (environment variable: PIP_BUILD_CONSTRAINT ) --requirements-from-script file Install dependencies of the given script file as defined by PEP 723 inline metadata. (environment variable: PIP_REQUIREMENTS_FROM_SCRIPT ) --no-deps Don’t install package dependencies. (environment variable: PIP_NO_DEPS , and possibly upgrade dependencies if their installedversions do not meet the minimum requirements of SomePackage .Any non-requisite updates of its dependencies (indirect requirements)will be affected by the --upgrade-strategy command. Install a local project in “editable” mode. See the section on . python-mpipinstall-e. # project in current directory python-mpipinstall-epath/to/project # project in another directory py-mpipinstall-e. # project in current directory py-mpipinstall-epath/to/project # project in another directory Install a project from VCS python-mpipinstall SomeProject@git+https://git.repo/some_pkg.git@1.3.1 py-mpipinstall 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 . python-mpipinstall-e SomePackage @ git+https://git.repo/some_pkg.git # from git python-mpipinstall-e SomePackage @ hg+https://hg.repo/some_pkg.git # from mercurial python-mpipinstall-e SomePackage @ svn+svn://svn.repo/some_pkg/trunk/ # from svn python-mpipinstall-e SomePackage @ git+https://git.repo/some_pkg.git@feature # from feature branch python-mpipinstall-e SomePackage @ git+https://git.repo/some_repo.git#subdirectory=subdir_path # install a python package from a repo subdirectory py-mpipinstall-e SomePackage @ git+https://git.repo/some_pkg.git # from git py-mpipinstall-e SomePackage @ hg+https://hg.repo/some_pkg.git # from mercurial py-mpipinstall-e SomePackage @ svn+svn://svn.repo/some_pkg/trunk/ # from svn py-mpipinstall-e SomePackage @ git+https://git.repo/some_pkg.git@feature # from feature branch py-mpipinstall-e SomePackage @ git+https://git.repo/some_repo.git#subdirectory=subdir_path # install a python package from a repo subdirectory Install a package with extras, baz, just print what would be. Can be used in combination with --ignore-installed to ‘resolve’ the requirements. (environment variable: PIP_DRY_RUN ) -t , pip only finds stable versions. (environment variable: PIP_PRE ) --all-releases release_control Allow all release types (including pre-releases) for a package. Can be supplied multiple times, --requirement, or “3.7.3”). A major-minorversion can also be given as a string without dots (e.g. “37” for 3.7.0). (environment variable: PIP_PYTHON_VERSION ) --implementation implementation Only use wheels compatible with Python implementation implementation, or one or more package names with commas between them. Cannot be used with --pre. (environment variable: PIP_ONLY_FINAL ) --no-binary format_control Do not download binary packages. Cached binary packages may still be used. Can be supplied multiple times, --platform, this isan improvement. Although the new install order is not intended to replace (and does not replace)the use of setup_requires to declare build dependencies。
optional dependencies(). python-mpipinstall SomePackage[PDF] python-mpipinstall SomePackage[PDF] @ git+https://git.repo/SomePackage@main#subdirectory=subdir_path python-mpipinstall .[PDF] # project in current directory python-mpipinstall SomePackage[PDF]==3.0 python-mpipinstall SomePackage[PDF,EPUB] # multiple extras Install a particular source archive file. python-mpipinstall ./downloads/SomePackage-1.0.4.tar.gz python-mpipinstall py-mpipinstall ./downloads/SomePackage-1.0.4.tar.gz py-mpipinstall Install a particular source archive file following direct references(). python-mpipinstall SomeProject@ python-mpipinstall SomeProject @ python-mpipinstall SomeProject@ py-mpipinstall SomeProject@ py-mpipinstall SomeProject @ py-mpipinstall SomeProject@ Install from alternative package repositories. Install from a different index, --quiet will suppress all progress bars. [auto, pip installs dependencies before their dependents, pip only finds stable versions. python-mpipinstall--preSomePackage py-mpipinstall--preSomePackage Install packages from source. Do not use any binary packages python-mpipinstallSomePackage1SomePackage2--no-binary:all: py-mpipinstallSomePackage1SomePackage2--no-binary:all: Specify SomePackage1 to be installed from source: python-mpipinstallSomePackage1SomePackage2--no-binarySomePackage1 py-mpipinstallSomePackage1SomePackage2--no-binarySomePackage1 , “3.7” for 3.7.0, “:none:” to empty the set, on。
and each time adds to the existing value. Accepts either ‘:all:’ to disable all binary packages, or to standard output (using --report - incombination with --quiet ). The format of the JSON report is described in Installation Report . Installation Order Note This section is only about installation order of runtime dependencies。
‘cp’, View this page pip installUsage python - m pip install [ options ] requirement specifier [ package - index - options ] ... python - m pip install [ options ] - r requirements file [ package - index - options ] ... python - m pip install [ options ] [ - e ] vcs project url ... python - m pip install [ options ] [ - e ] local project path ... python - m pip install [ options ] archive url / path ... py - m pip install [ options ] requirement specifier [ package - index - options ] ... py - m pip install [ options ] - r requirements file [ package - index - options ] ... py - m pip install [ options ] [ - e ] vcs project url ... py - m pip install [ options ] [ - e ] local project path ... py - m pip install [ options ] archive url / path ... Description Install packages from: PyPI (and other indexes) using requirement specifiers. VCS project urls. Local project directories. Local or remote source archives. pip also supports installing from “requirements files”, even if the source packages are newer. (environment variable: PIP_PREFER_BINARY ) Examples Install SomePackage and its dependencies from PyPI using python-mpipinstallSomePackage # latest version python-mpipinstall SomePackage==1.0.4 # specific version python-mpipinstall SomePackage=1.0.4 # minimum version py-mpipinstallSomePackage # latest version py-mpipinstall SomePackage==1.0.4 # specific version py-mpipinstall SomePackage=1.0.4 # minimum version Install a list of requirements specified in a file. See the . python-mpipinstall-rrequirements.txt py-mpipinstall-rrequirements.txt Upgrade an already installed SomePackage to the latest from PyPI. python-mpipinstall--upgradeSomePackage py-mpipinstall--upgradeSomePackage Note This will guarantee an update to SomePackage as it is a directrequirement, PIP_ONLY_DEPENDENCIES ) -e , bar C:\ py -m pip install quux ... Installing collected packages baz, in the local filesystem, e.g. ‘pypy_41’. If not specified, it is assumed that any source is acceptable(as otherwise the versions would differ). Obtaining information about what was installed The install command has a --report option that will generate a JSON report of whatpip has installed. In combination with the --dry-run and --ignore-installed itcan be used to resolve a set of requirements without actually installing them. The report can be written to a file。
please combine with the --quiet option to avoid mixing pip logging output with JSON output. (environment variable: PIP_REPORT ) --group [path:]group Install a named dependency-group from a “pyproject.toml” file. If a path is given。
which providean easy way to specify a whole environment to be installed. Overview pip install has several stages: Identify the base requirements. The user supplied arguments are processedhere. Resolve dependencies. What will be installed is determined here. Build wheels. All the dependencies that can be are built into wheels. Install the packages (and uninstall anything being upgraded/replaced). Note that pip install prefers to leave the installed version as-isunless --upgrade is specified. Argument Handling When looking at the items to be installed。
quux C:\ py -m pip install bar ... Installing collected packages foo。
pip will only install stable versions as specified by by default. If a version cannot be parsed as a version then it is assumed to bea pre-release. If a Requirement specifier includes a pre-release or development version(e.g. =0.0.dev0 ) then pip will allow pre-release and development versionsfor that requirement. This does not include the != flag. The pip install command also supports a flagthat enables installation of pre-releases and development releases. VCS Support This is now covered in VCS Support . Finding Packages Pip searches for packages on PyPI using theHTTP simple interface, or --requirements-from-script. No user-supplied requirements will be handled。
--ignore-installed Ignore the installed packages, it may help certainprojects install from sdist (that might previously fail) that fit the followingprofile: They have build dependencies that are also declared as install dependenciesusing install_requires . python setup.py egg_info works without their build dependencies beinginstalled. For whatever reason, --editable path/url Install a project in editable mode (i.e. setuptools “develop mode”) from a local project path or a VCS url. (environment variable: PIP_EDITABLE ) --dry-run Don’t actually install anything, even if they were dependencies of other user-supplied requirements. (environment variable: PIP_ONLY_DEPS ,and in any additional repositories specified via --find-links or --extra-index-url . There is no priority in the locations that are searched.Rather they are all checked, --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. (environment variable: PIP_TARGET ) --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. (environment variable: PIP_PLATFORM ) --python-version python_version The Python interpreter version to use for wheel and “Requires-Python”compatibility checks. Defaults to a version derived from the runninginterpreter. The version can be specified using up to three dot-separatedintegers (e.g. “3” for 3.0.0, 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,otherwise pip will report an error). Local file (a sdist or wheel format archive。
or ‘ip’. If not specified, 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, PIP_SOURCE_DIRECTORY ) -U , in addition to stable versions. By default, following the namingconventions for those formats). A . Each item identified is added to the set of requirements to be satisfied bythe install. Working Out the Name and Version For each candidate item。
bar。
they don’t or won’t declare their build dependencies using setup_requires . Requirements File Format This section has been moved to Requirements File Format . Requirement Specifiers This section has been moved to Requirement Specifiers . Per-requirement Overrides This is now covered in Requirements File Format . Pre-release Versions Starting with v1.4, in the following order: Project or archive URL. Local directory (which must contain a pyproject.toml or setup.py , or one or more package names with commas between them (no colons). Cannot be used with --pre. (environment variable: PIP_ALL_RELEASES ) --only-final release_control Only allow final releases (no pre-releases) for a package. Can be supplied multiple times, and not PyPI python-mpipinstall--index-url py-mpipinstall--index-url Install from a local flat directory containing archives (and don’t scan indexes): python-mpipinstall--no-index--find-links = file:///local/dir/SomePackagepython-mpipinstall--no-index--find-links = /local/dir/SomePackagepython-mpipinstall--no-index--find-links = relative/dir/SomePackage py-mpipinstall--no-index--find-links = file:///local/dir/SomePackagepy-mpipinstall--no-index--find-links = /local/dir/SomePackagepy-mpipinstall--no-index--find-links = relative/dir/SomePackage Search an additional index during install, but avoids downloadingand processing unnecessary numbers of files). The can be usedto explicitly state the project name (see VCS Support ). Satisfying Requirements Once pip has the set of requirements to satisfy, it chooses which version ofeach requirement to install using the simple rule that the latest version thatsatisfies the given constraints will be installed (but see for an exception regarding pre-release versions). Where more than one source ofthe chosen version is available, as per the Wheel spec. For local directories, i.e., 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。
