pip#

Usage#

python -m pip <command> [options]
py -m pip <command> [options]

Description#

Logging#

Console logging#

pip offers -v, --verbose and -q, --quiet to control the console log level. By default, some messages (error and warnings) are colored in the terminal. If you want to suppress the colored output use --no-color.

File logging#

pip offers the --log option for specifying a file where a maximum verbosity log will be kept. This option is empty by default. This log appends to previous logging.

Like all pip options, --log can also be set as an environment variable, or placed into the pip config file. See the Configuration section.

--exists-action option#

This option specifies default behavior when path already exists. Possible cases: downloading files or checking out repositories for installation, creating archives. If --exists-action is not defined, pip will prompt when decision is needed.

(s)witch

Only relevant to VCS checkout. Attempt to switch the checkout to the appropriate URL and/or revision.

(i)gnore

Abort current operation (e.g. don’t copy file, don’t create archive, don’t modify a checkout).

(w)ipe

Delete the file or VCS checkout before trying to create, download, or checkout a new one.

(b)ackup

Rename the file or checkout to {name}{'.bak' * n}, where n is some number of .bak extensions, such that the file didn’t exist at some point. So the most recent backup will be the one with the largest number after .bak.

(a)bort

Abort pip and return non-zero exit status.

Build System Interface

This is now covered in Build System Interface.

General Options#

-h, --help#

Show help.

(environment variable: PIP_HELP)

--debug#

Let unhandled exceptions propagate outside the main subroutine, instead of logging them to stderr.

(environment variable: PIP_DEBUG)

--isolated#

Run pip in an isolated mode, ignoring environment variables and user configuration.

(environment variable: PIP_ISOLATED)

--require-virtualenv#

Allow pip to only run in a virtual environment; exit with an error otherwise.

(environment variable: PIP_REQUIRE_VIRTUALENV, PIP_REQUIRE_VENV)

--python <python>#

Run pip with the specified Python interpreter.

(environment variable: PIP_PYTHON)

-v, --verbose#

Give more output. Option is additive, and can be used up to 3 times.

(environment variable: PIP_VERBOSE)

-V, --version#

Show version and exit.

(environment variable: PIP_VERSION)

-q, --quiet#

Give less output. Option is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL logging levels).

(environment variable: PIP_QUIET)

--log <path>#

Path to a verbose appending log.

(environment variable: PIP_LOG, PIP_LOG_FILE, PIP_LOCAL_LOG)

--no-input#

Disable prompting for input.

(environment variable: PIP_NO_INPUT)

--keyring-provider <keyring_provider>#

Enable the credential lookup via the keyring library if user input is allowed. Specify which mechanism to use [disabled, import, subprocess]. (default: disabled)

(environment variable: PIP_KEYRING_PROVIDER)

--proxy <proxy>#

Specify a proxy in the form scheme://[user:passwd@]proxy.server:port.

(environment variable: PIP_PROXY)

--retries <retries>#

Maximum number of retries each connection should attempt (default 5 times).

(environment variable: PIP_RETRIES)

--timeout <sec>#

Set the socket timeout (default 15 seconds).

(environment variable: PIP_TIMEOUT, PIP_DEFAULT_TIMEOUT)

--exists-action <action>#

Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.

(environment variable: PIP_EXISTS_ACTION)

--trusted-host <hostname>#

Mark this host or host:port pair as trusted, even though it does not have valid or any HTTPS.

(environment variable: PIP_TRUSTED_HOST)

--cert <path>#

Path to PEM-encoded CA certificate bundle. If provided, overrides the default. See ‘SSL Certificate Verification’ in pip documentation for more information.

(environment variable: PIP_CERT)

--client-cert <path>#

Path to SSL client certificate, a single file containing the private key and the certificate in PEM format.

(environment variable: PIP_CLIENT_CERT)

--cache-dir <dir>#

Store the cache data in <dir>.

(environment variable: PIP_CACHE_DIR)

--no-cache-dir#

Disable the cache.

(environment variable: PIP_NO_CACHE_DIR)

--disable-pip-version-check#

Don’t periodically check PyPI to determine whether a new version of pip is available for download. Implied with --no-index.

(environment variable: PIP_DISABLE_PIP_VERSION_CHECK)

--no-color#

Suppress colored output.

(environment variable: PIP_NO_COLOR)

--no-python-version-warning#

Silence deprecation warnings for upcoming unsupported Pythons.

(environment variable: PIP_NO_PYTHON_VERSION_WARNING)

--use-feature <feature>#

Enable new functionality, that may be backward incompatible.

(environment variable: PIP_USE_FEATURE)

--use-deprecated <feature>#

Enable deprecated functionality, that will be removed in the future.

(environment variable: PIP_USE_DEPRECATED)