py2exe linux equivalent

Albert Hopkins marduk at letterboxes.org
Fri Mar 20 16:30:19 EDT 2009


On Fri, 2009-03-20 at 12:59 -0700, Brendan Miller wrote:
> I have a python application that I want to package up and deploy to
> various people using RHEL 4.
> 
> I'm using python 2.6 to develop the app. The RHEL 4 machines have an
> older version of python I'd rather not code against (although that's
> an option). My main stumbling block is I need to use a couple of
> python modules (paramiko and pycrypto) that include C bits in them.

You are probably going the wrong route if you are developing in/for an
environment that is not the same as the one to which you plan to deploy.


> Is there any tool out there that can pull in my dependencies and give
> me a packaged binary that I can hand off to my users without worrying
> about them having my modules or the right version of python? Extra
> credit if it generates an RPM for me.
> 
> It really doens't matter if the binary generated is somewhat bloated
> with excess dependencies. It can include glibc for all I care.
> 
> The main thing keeping me from using all kinds of python in my linux
> development at work is not being able to package up the results and
> hand them off in a convenient way.

The tool, for RHEL, is RPM.  This, with distutils[1] is the Right Way
(TM) to do it.

Having said that, you can try the freeze module, but there are caveats
especially when dealing with shared libs.  Since you mentioned you
require shared libs, you will still need to ship these for your target
platform. AFAICT there are RHEL4 rpms for these, and RHEL4 already comes
with its own version of Python so it seems you are attempting to make
things much more difficult than need be.


1. http://www.python.org/doc/current/distutils/index.html






More information about the Python-list mailing list