Learning which modules were loaded

James Stroud jstroud at mbi.ucla.edu
Fri Jun 6 17:20:37 EDT 2008


I am rolling up a distribution of a program I wrote. It uses matplotlib 
with tkagg so the bundle is HUGE (47 MB, 14 MB after bz compression). Is 
there any way to run the program, put it through all of its paces, and 
then inspect which modules were loaded. I would like to gather these in 
a list and delete any others that py2app and py2exe attempt to include. 
Currently, these (or py2app, at least) use dependency graphing and 
icnlude everything belonging to pylab, matplotlib, and numpy by default. 
I don't want everything, I only want what my program needs to run. For 
example, some modules are imported by functions (in Pmw, for example) 
that never get called. I don't want to include these.

Thanks in advance for any help.

James



More information about the Python-list mailing list