I would like to get a list of Python modules, which are in my Python installation (UNIX server).
How can you get a list of Python modules installed in your computer?
Installation
pip install pkgutil
Code
import pkgutil for i in pkgutil.iter_modules(None): # returns a tuple (path, package_name, ispkg_flag) print(i[1]) #or you can append it to a list
Sample Output:
multiprocessing netrc nntplib ntpath nturl2path numbers opcode pickle pickletools pipes pkgutil