Listing all available (not just loaded) modules

Michael Hudson mwh at python.net
Tue Jun 18 07:35:38 EDT 2002


"Michael Steuer" <mike at radiomag.com> writes:

> I've been searching the newsgroup for information on this but so far
> have been unsuccessful:
> 
> Is there a way to dynamically list all available modules (not just those that
> are already loaded) in python? 

In general, no, because of __import__ hooks and the like.

> By available I mean those modules, which are
> installed on the machine executing python (in the lib path(s)).

pyrepl contains some nasty code to do this, if you get stuck with the
other packages you were pointed to.

Really must do some work on pyrepl soon.

Cheers,
M.

-- 
  MGM will not get your whites whiter or your colors brighter.
  It will, however, sit there and look spiffy while sucking down
  a major honking wad of RAM.              -- http://www.xiph.org/mgm/



More information about the Python-list mailing list