Freezing Python (was Re: [Python-Dev] 2.4 news reaches interesting places)

Bob Ippolito bob at
Thu Dec 9 22:30:30 CET 2004

On Dec 9, 2004, at 4:20 PM, Barry Warsaw wrote:

> On Thu, 2004-12-09 at 10:30, Phillip J. Eby wrote:
>> ISTR that for a long time, Visual Basic actually did the same thing.  
>> A few
>> magazines mentioned the fact, but nobody really cared.  However, if 
>> this is
>> really a concern, bundle Pyrex as well.  Both Pyrex and py2exe are
>> distutils-based, so at that point you have a complete solution, 
>> including
>> the "C" meme as well as the ".exe" meme.
> As an aside, I wonder if there's interest in collaborating on freeze
> tools among the various existing solutions here.  I've recently needed
> to look at this and I chose cx_Freeze, primarily because it supported
> the platforms I needed.  It's a very good tool.
> I've had some conversations with Anthony Tuininga on the cx_Freeze
> mailing list and there seems to be some interest in perhaps putting
> together a SIG or something.

That's certainly worth doing.  Currently we have, in general use, at 
least cx_Freeze, py2exe, and py2app.

I have been abstracting away a lot of the dependency finding issues in 
py2app into a cross-platform module called modulegraph 
Modulegraph supercedes the standard library modulefinder.  Because it 
uses a graph data structure, it gives you the flexibility say "pydoc 
doesn't *really* depend on Tkinter".  It also has functionality that 
lets you specify implicit dependencies (via PyImport_.. or such), so 
that it plays nicely enough with C extensions.

This code is basically at the point where py2exe and cx_Freeze could 
import it and use it instead of modulefinder (with a small amount of 
hacking, the API is different).


More information about the Python-Dev mailing list