Standalone Python Programs...

U

uri bushey

I have a Python program that is built on an infrastructure of quite a
few other programs, but I would like to create a standalone nonetheless.

It doesn't necesarily have to be its own executable, although this is
the most attractive option - it could just mean distributing the entire
python distribution with it in an installer or something.

However, here is what I have called in my python file:
Tkinter, and multiple Pmw widgets
WaveSurfer, called as a "Wsurf" widget, which is a great little program
used for Spectrograms of wave files etc. It relies on Tcl/Tk and the
SNACK library, which also have to be installed for my script to work.

Can anyone help? I'm open to any option, py2xe, mcmillan's, or cx_freeze
or whatever that program is, or even an installer that installs all of
those programs.

I'm vying for the most elegant solution.

Thanks!

--uri
 
L

Larry Bates

I've found that py2exe and Inno Setup Installeer to be a good
combination (for Windows). It isn't a single executable, but
then what modern program is any more. It doesn't require
distribution/installation of Python. I've used it to install
some pretty complex combinations (wxWindows, PIL, ReportLab,
etc.) with no problems. Inno Setup has proven to be flexible
enough to install everything that I've done so far.

I can't speak to Linux installations because I have always
just used the Python installation already there.

HTH,
Larry Bates
Syscon, Inc.
 
G

Grant Edwards

That's a false dichotomy. There is a choice in-between a
"stand-alone program" and "an entire Python distribution":
Something like py2exe which creates a "distribution" containing
only the things (dll's and compiled+compressed Python modules)
needed by your application.

Besides, expecting to create a stand-alone executable is pretty
unrealistic these days. There are very, very few stand-alone
Win32 programs any more (putty.exe is the only one I've seen in
the past 5 years). Everything else in the Win32 world seems to
need to have a set of files "installed" using an installer.
I've found that py2exe and Inno Setup Installeer to be a good
combination (for Windows). It isn't a single executable, but
then what modern program is any more. It doesn't require
distribution/installation of Python. I've used it to install
some pretty complex combinations (wxWindows, PIL, ReportLab,
etc.) with no problems. Inno Setup has proven to be flexible
enough to install everything that I've done so far.

Same here. I've used py2exe + Inno Setup for a handfull of
small wxPython applications and it's all worked quite nicely.
I can't speak to Linux installations because I have always
just used the Python installation already there.

Yup.
 
S

simo

Grant Edwards said:
Same here. I've used py2exe + Inno Setup for a handfull of
small wxPython applications and it's all worked quite nicely.

Same here too, InnoSetup is especially useful if you need to bundle
auxilliary files like icons, images, ChangeLogs etc. or make
desktop/startbar shortcuts.

I think py2exe is perfect, cx_Freeze is still not 100%

I tried McMillan Installer on Linux, and had little success - because
even if you get the binary to build, it usually has .so dependency
issues - basically you need wxWidgets or GTK+ or whatever installed on
top of any Python you've coded.

I've falling back to providing the source and leaving it as an
exercise to the user to install all the Python modules they may not
have in their base install.

One of the attractions of IronPython is that you can build a single
..exe (or .bin on Linux I guess?) although the user still needs the CLR
runtime installed.
 
U

uri bushey

So per everyone's advice, I decided to make a go of it with py2exe.
Unfortunately I'm getting a traceback instead of an executable.
It states: "WindowsError: [Errno 3] The system cannot find the path
specified:
'C:\\PythonProgram\\dist\\library.zip\\Pmw/*.*'
I did some searching and discovered that I have to use 'bundlepmw.' So I
did this, and then I get an error about one of my libraries instead:

_tkinter.TclError: Can't find package wsurf 1.7

So I added this to dist\tcl, and then I get an error about my next
library, snack. Well, adding all of these libraries is eventually going
to defeat the purpose of freezing the program, isn't it? Wsurf itself is
4 MB!

Is there something else i should be doing?
 
D

David Fraser

simo said:
One of the attractions of IronPython is that you can build a single
.exe (or .bin on Linux I guess?) although the user still needs the CLR
runtime installed.
One of the attractions of Python is that you can build a single frozen
file although the user still needs the Python interpreter installed ...

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top