Posted by José Lopes
When you run py2exe for a small Python program you may notice that the file library.zip it's
too big.
This may cause some problems if you're planning to make a distribution.
This post explains why and how to minimize this file size.
This problem is often a consequence of the compatibility problem between projects, already described on this post.
For all your projects py2exe keeps all the necessary data on the directory build, including
the compiled python modules (files with the extension .pyc or .pyo).
If no reset is done to this directory between projects (deleting all its content), py2exe will accumulate data.
Even when you don't get a compatibility problem when running the programs between projects, the fact is that
a lot of files will pile up on the build directory and naturally increasing the library.zip file
that may get to a several MBytes size.
The methods you have to avoid this are: