How can I get a list of locally installed Python modules?


There are multiple ways to get a list of locally installed Python modules. Easiest way is using the Python shell, for example,

>>> help('modules')
Please wait a moment while I gather a list of all available modules...
BaseHTTPServer      brain_nose          markupbase          stat
Bastion             brain_numpy         marshal             statvfs
CGIHTTPServer       brain_pkg_resources math                string
Canvas              brain_pytest        matplotlib          stringold
...
...

If you want to get the list of installed modules in your terminal, you can use the Python package manager, pip. For example,

$ pip freeze

You will get the output:

asn1crypto==0.22.0
astroid==1.5.2
attrs==16.3.0
Automat==0.5.0
backports.functools-lru-cache==1.3
cffi==1.10.0
...

If you have pip version >= 1.3, you can also use pip list. For example,

$ pip list
asn1crypto (0.22.0)
astroid (1.5.2)
attrs (16.3.0)
Automat (0.5.0)
backports.functools-lru-cache (1.3)
...
...

Updated on: 30-Sep-2019

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements