Attempting to use py2exe on a program that
contains 'import site' causes a very large number of
modules to be included in the build, including all of the
The reason appears to be that site.py can import pydoc,
and pydoc references lots including all the web stuff and
tkinter. The work around is simply to put --
exclude=pydoc on the command line, however it took
quite some time to find which module was responsible.
It would be nice if there was some easy way to ask
py2exe why it included a particular module.
It would also be nice if there was a list of default
exclusions (ignore module 'x' when imported only by 'y').