Getting a list of all modules

Akira Li 4kir4.1i at
Thu Jul 31 20:55:34 CEST 2014

Steven D'Aprano <steve at> writes:

> I'm looking for a programmatic way to get a list of all Python modules 
> and packages. Not just those already imported, but all those which 
> *could* be imported.
> Is this problem already solved? Can anyone make any suggestions?

Look at how `help('modules')` is implemented. Though it crashes on my

See also,

How can I get a list of locally installed Python modules? [1]
python - get available modules [2]



More information about the Python-list mailing list