Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print everything that can be imported [duplicate]

Possible Duplicate:
Unable to get a list of installed Python modules

How do I print a list of all the modules that are available for import from within my script in Python3?

like image 832
Baz Avatar asked Feb 08 '12 13:02

Baz


1 Answers

To access the list of all installed modules accessible via sys.path programmatically rather than inside an interactive session, you can use pkgutil.iter_modules().

like image 85
Sven Marnach Avatar answered Oct 09 '22 10:10

Sven Marnach