Is there a way in Python to list all installed packages and their versions?
I know I can go inside
python/Lib/site-packages and see what files and directories exist, but I find this very awkward. What I'm looking for something that is similar to
npm list i.e. npm-ls.
If you have pip install and you want to see what packages have been installed with your installer tools you can simply call this:
It will also include version numbers for the installed packages.
pip has been updated to also produce the same output as
pip freeze by calling:
The output from
pip list is formatted differently, so if you have some shell script that parses the output (maybe to grab the version number) of
freeze and want to change your script to call
list, you'll need to change your parsing code.
help('modules') should do it for you.
in IPython :
In : import #import press-TAB Display all 631 possibilities? (y or n) ANSI audiodev markupbase AptUrl audioop markupsafe ArgImagePlugin avahi marshal BaseHTTPServer axi math Bastion base64 md5 BdfFontFile bdb mhlib BmpImagePlugin binascii mimetools BufrStubImagePlugin binhex mimetypes CDDB bisect mimify CDROM bonobo mmap CGIHTTPServer brlapi mmkeys Canvas bsddb modulefinder CommandNotFound butterfly multifile ConfigParser bz2 multiprocessing ContainerIO cPickle musicbrainz2 Cookie cProfile mutagen Crypto cStringIO mutex CurImagePlugin cairo mx DLFCN calendar netrc DcxImagePlugin cdrom new Dialog cgi nis DiscID cgitb nntplib DistUpgrade checkbox ntpath