List all packages, modules installed in python – pip list

There are three ways to get the list of all the libraries or packages or modules installed in python using pip list command, pip freeze command  and help function .

All the three ways of listing all the packages installed in python are explained below along with we also explained.

  • Pip list all the outdated package installed in python
  • pip list all the up to date package installed in python
  • pip list all installed packages in json format
  • pip list installed packages along with package version

 

 

1. List all the packages, modules installed in python Using pip list:

open Anaconda prompt  and type the following command.

pip list

This will get the list of installed packages along with their version in angular braces which is shown below

list of all packages and libraries installed in python 3

 

Syntax for pip list command :

python -m pip list [options]

 

OptionsExplanation /Usage
-o, --outdatedList outdated packages
-u, --uptodateList uptodate packages
-e, --editableList editable projects.
-l, --localIf in a virtualenv that has global access, do not list globally-installed packages.
--userOnly output packages installed in user-site.
--path Restrict to the specified installation path for listing packages (can be used multiple times).
--preInclude pre-release and development versions. By default, pip only finds stable versions.
--format Select the output format among: columns (default), freeze, or json
--not-requiredList packages that are not dependencies of installed packages.
--exclude-editableExclude editable package from output.
--include-editableInclude editable package from output.
--exclude Exclude specified package from the output
-i, --index-url Base URL of the Python Package Index. 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 Extra URLs of package indexes to use in addition to --index-url. Should follow the same rules as --index-url.
--no-indexIgnore package index (only looking at --find-links URLs instead).

Some Examples of pip list command with options:

a) Pip List all the installed packages with version (with the default column formatting).

python -m pip list

pip list - list all packages and modules installed in python 1

 

b) Pip List all outdated packages installed in python.
python -m pip list –outdated

pip list - list all packages and modules installed in python 2

 

c) List all outdated Packages that are not dependencies of other packages.

python -m pip list –outdated –not-required

pip list - list all packages and modules installed in python 3

 

d) pip list – list all the packages installed using json formatting

python -m pip list –format=json

pip list - list all packages and modules installed in python 4

 

e) pip list using freeze formatting

python -m pip list –format=freeze

pip list - list all packages and modules installed in python 5

 

f) pip list – python List packages that are not dependencies of installed packages.

python -m pip list –not-required

pip list - list all packages and modules installed in python 6

 

g) pip list – python list all package that are upto date.

python -m pip list -u
pip list - list all packages and modules installed in python 7

 

 

2. Get the list of all the packages in python Using Help function:

To get the list of installed packages in python you can simply type the below command in python IDE

help(“modules”)

 

list of all packages and libraries installed in python 1

This will list all the modules installed in the system .

list of all packages and libraries installed in python 2

 

 

3.  List all the packages, modules installed in python Using pip freeze:

Open command prompt on your windows and type the following command

pip freeze

This will get the list of installed packages along with their version as shown below

list of all packages and libraries installed in python 4

These are the three different methods that lists the packages or libraries installed in python.

 

 

previous small packages or modules installed in python                                                                                                           next small packages or modules installed in python

Author

  • Sridhar Venkatachalam

    With close to 10 years on Experience in data science and machine learning Have extensively worked on programming languages like R, Python (Pandas), SAS, Pyspark.

    View all posts