How to build a list of all modules in standard library?

python at python at
Wed Feb 17 15:57:27 CET 2010

We're building a py2exe executable that may need to do some
dynamic module imports.

I'm looking for suggestions on how we can mechanically generate a
list of standard library modules/packages to make sure our build
has the full set of Python 2.6.4 libraries.

We're planning on creating a module called that
explictly imports all modules within an "if False:" block of code
per example below and then importing this script ( in
our main script.

# - insure that py2exe imports all modules in its build

if False:
     # list of all standard modules
     import <module -1>
     import <module-N>

     # list of 3rd party modules
     import win32api
     import wmi

Any suggestions or feedback appreciated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list