Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#2 import site.py pulls in too many modules

open
nobody
None
5
2002-07-31
2002-07-31
Duncan Booth
No

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
tk stuff.

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').

Discussion

  • Thomas Heller
    Thomas Heller
    2002-07-31

    Logged In: YES
    user_id=11105

    Why do you need to 'import site' (just curious)?

    Some time ago I did some work to create import cross-
    references with modulefinder, with the result that it didn't work
    any longer :-(. This was together with a GUI to display these
    trees. Maybe I can revive the idea again, but don't hold your
    breath.

    Hm, I mark this as a feature request.