Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

py2exe linux equivalent

68 views
Skip to first unread message

Brendan Miller

unread,
Mar 20, 2009, 3:59:17 PM3/20/09
to pytho...@python.org
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.

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.

Thanks,
Brendan

Mike Driscoll

unread,
Mar 20, 2009, 4:20:51 PM3/20/09
to

I've heard that PyInstaller can do this, but haven't actually tried
it. Let me know how it goes though, if you get the chance. Here's a
link:

http://pyinstaller.python-hosting.com/

You might also look at cx_freeze or bbfreeze.

Mike

Albert Hopkins

unread,
Mar 20, 2009, 4:30:19 PM3/20/09
to pytho...@python.org
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

Brendan Miller

unread,
Mar 20, 2009, 5:02:09 PM3/20/09
to Albert Hopkins, pytho...@python.org
> 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.

There are no rpm's in our repository for the third party modules I
need... If it was that easy I wouldn't be asking.

Brendan Miller

unread,
Mar 20, 2009, 5:22:02 PM3/20/09
to pytho...@python.org
So it sounds like the options are PyInstaller, cx_freeze, and
bbfreeze. Has anyone used any of these, and knows which one works best
on linux?
0 new messages