pip list

Usage

Unix/macOS

  1. python -m pip list [options]

Windows

  1. py -m pip list [options]

Description

List installed packages, including editables.

Packages are listed in a case-insensitive sorted order.

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

--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.

Examples

  1. List installed packages.

    Unix/macOS

    1. $ python -m pip list
    2. docutils (0.10)
    3. Jinja2 (2.7.2)
    4. MarkupSafe (0.18)
    5. Pygments (1.6)
    6. Sphinx (1.2.1)

    Windows

    1. C:\> py -m pip list
    2. docutils (0.10)
    3. Jinja2 (2.7.2)
    4. MarkupSafe (0.18)
    5. Pygments (1.6)
    6. Sphinx (1.2.1)
  2. List outdated packages (excluding editables), and the latest version available.

    Unix/macOS

    1. $ python -m pip list --outdated
    2. docutils (Current: 0.10 Latest: 0.11)
    3. Sphinx (Current: 1.2.1 Latest: 1.2.2)

    Windows

    1. C:\> py -m pip list --outdated
    2. docutils (Current: 0.10 Latest: 0.11)
    3. Sphinx (Current: 1.2.1 Latest: 1.2.2)
  3. List installed packages with column formatting.

    Unix/macOS

    1. $ python -m pip list --format columns
    2. Package Version
    3. ------- -------
    4. docopt 0.6.2
    5. idlex 1.13
    6. jedi 0.9.0

    Windows

    1. C:\> py -m pip list --format columns
    2. Package Version
    3. ------- -------
    4. docopt 0.6.2
    5. idlex 1.13
    6. jedi 0.9.0
  4. List outdated packages with column formatting.

    Unix/macOS

    1. $ python -m pip list -o --format columns
    2. Package Version Latest Type
    3. ---------- ------- ------ -----
    4. retry 0.8.1 0.9.1 wheel
    5. setuptools 20.6.7 21.0.0 wheel

    Windows

    1. C:\> py -m pip list -o --format columns
    2. Package Version Latest Type
    3. ---------- ------- ------ -----
    4. retry 0.8.1 0.9.1 wheel
    5. setuptools 20.6.7 21.0.0 wheel
  5. List packages that are not dependencies of other packages. Can be combined with other options.

    Unix/macOS

    1. $ python -m pip list --outdated --not-required
    2. docutils (Current: 0.10 Latest: 0.11)

    Windows

    1. C:\> py -m pip list --outdated --not-required
    2. docutils (Current: 0.10 Latest: 0.11)
  6. Use legacy formatting

    Unix/macOS

    1. $ python -m pip list --format=legacy
    2. colorama (0.3.7)
    3. docopt (0.6.2)
    4. idlex (1.13)
    5. jedi (0.9.0)

    Windows

    1. C:\> py -m pip list --format=legacy
    2. colorama (0.3.7)
    3. docopt (0.6.2)
    4. idlex (1.13)
    5. jedi (0.9.0)
  7. Use json formatting

    Unix/macOS

    1. $ python -m pip list --format=json
    2. [{'name': 'colorama', 'version': '0.3.7'}, {'name': 'docopt', 'version': '0.6.2'}, ...

    Windows

    1. C:\> py -m pip list --format=json
    2. [{'name': 'colorama', 'version': '0.3.7'}, {'name': 'docopt', 'version': '0.6.2'}, ...
  8. Use freeze formatting

    Unix/macOS

    1. $ python -m pip list --format=freeze
    2. colorama==0.3.7
    3. docopt==0.6.2
    4. idlex==1.13
    5. jedi==0.9.0

    Windows

    1. C:\> py -m pip list --format=freeze
    2. colorama==0.3.7
    3. docopt==0.6.2
    4. idlex==1.13
    5. jedi==0.9.0

Important

Did this article help?

We are currently doing research to improve pip’s documentation and would love your feedback. Please email us &body=%0A%20%20%20%200.%20Document:%20reference/pip_list.%20Page%20URL:%20https:/%20%0A%0A%20%20%20%201.%20What%20problem%20were%20you%20trying%20to%20solve%20when%20you%20came%20to%20this%20page?%20%0A%0A%20%20%20%202.%20What%20content%20was%20useful?%20%0A%0A%20%20%20%203.%20What%20content%20was%20not%20useful?) and let us know:

  1. What problem were you trying to solve when you came to this page?

  2. What content was useful?

  3. What content was not useful?