473,387 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Single-file executables

Which of the Windows/Unix package builders for Python applications is
capable of creating single-file executables? I'm thinking of:

1. py2exe
2. Mcmillan Installer/PyInstaller
3. cxfreeze

The apps I've seen created by py2exe aren't single-file at all, the
install folder is full of files besides the main program. I'm looking
for a solution that stuffs all libraries, scripts, and the Python
runtime into one file.

--
Kevin Walzer
iReveal: File Search Tool
http://www.wordtech-software.com
Feb 11 '06 #1
13 4243
Kevin Walzer wrote:
The apps I've seen created by py2exe aren't single-file at all, the
install folder is full of files besides the main program. I'm looking
for a solution that stuffs all libraries, scripts, and the Python
runtime into one file.


For full control, and truly single-binary executables, I recommend
to use freeze itself. It takes a bit more work, but also gives better
results.

Regards,
Martin
Feb 12 '06 #2
Actually, py2exe (from version 0.6.1) onwards does create single file
exes without ANY additional dependencies.

Feb 12 '06 #3
Kevin Walzer wrote:
Which of the Windows/Unix package builders for Python applications is
capable of creating single-file executables? I'm thinking of:

1. py2exe
2. Mcmillan Installer/PyInstaller
3. cxfreeze

The apps I've seen created by py2exe aren't single-file at all, the
install folder is full of files besides the main program. I'm looking
for a solution that stuffs all libraries, scripts, and the Python
runtime into one file.


I use pyinstaller. Its easy and makes a single file, even if you have
compiled dependencies like pycrypto (I don't think freeze handles these
so well). If you want ease of installation for windows, check out Inno
Setup. It gives a single downloadable installer that helps get around
the "unknown publisher" problem, and system registry editing. In
summary: pyinstaller + inno setup.

James
Feb 12 '06 #4
Ravi Teja wrote:
Actually, py2exe (from version 0.6.1) onwards does create single file
exes without ANY additional dependencies.


They still require an external MSVCR71.DLL if made with Python 2.4. PyInstaller
1.1 (to be released today) does not have this problem.
--
Giovanni Bajo
Feb 12 '06 #5
Giovanni Bajo wrote:
Ravi Teja wrote:
Actually, py2exe (from version 0.6.1) onwards does create single file
exes without ANY additional dependencies.


They still require an external MSVCR71.DLL if made with Python 2.4. PyInstaller
1.1 (to be released today) does not have this problem.


Can you describe how they get around that issue? As far as I know, the
reason py2exe requires the external DLL is that the licensing of that
file does not permit completely free redistribution. Does PyInstaller
actually bundle it, or does it include an interpreter without any
dependency on that file?

-Peter

Feb 12 '06 #6
As Peter later pointed out, that is a licencing issue rather than a
tool issue. After browsing through the PyInstaller documentation, I
came across a curious snippet.

"On Windows, this provides support for doing in-process COM servers. It
is not generalized. However, embedders can follow the same model to
build a special purpose DLL so the Python support in their app is
hidden. You will need to write your own dll, but thanks to Allan Green
for refactoring the C code and making that a managable task."

I am assuming that this means it makes it easy to expose my Python code
as a plain dll. Just what I was looking for. I don't see any more
elaboration on this. Anyone tried this?

Feb 12 '06 #7
Martin v. Löwis wrote:
Kevin Walzer wrote:
The apps I've seen created by py2exe aren't single-file at all, the
install folder is full of files besides the main program. I'm
looking for a solution that stuffs all libraries, scripts, and the
Python runtime into one file.

Usually the bundle=1 option in py2exe can create a single file exe, but it also
allows to have a separate shared library.zip file, which is useful if you need more than
one exe-file. With python 2.4, MSVCR71.dll is still required and not bundled. There are
technical reasons ('booting' the exe) and maybe legal reasons for that.

For full control, and truly single-binary executables, I recommend to
use freeze itself. It takes a bit more work, but also gives better
results.

I wonder if anyone is actually using freeze on Windows, with scripts that use,
say, pywin32 and wxPython.

I've said it before, and say it again: Creating real single-file exes or dlls
was a non-goal for py2exe. The goal was to be able to create in-process COM
servers which provide a python interpreter that is totally isolated from possible
other interpreters running in the same process.

py2exe simulates a statically linked python interpreter together with statically
linked extension modules. So, it is very similar to what freeze creates.

Thomas

Feb 12 '06 #8
Thomas Heller wrote:
I wonder if anyone is actually using freeze on Windows, with scripts
that use, say, pywin32 and wxPython.


Interesting question. I've never done so myself (only on Linux and
Solaris), and given the relatively small interest in having a static
Python library on Windows, I guess the answer is no (or: everybody
doing that has managed to deal with the build process themselves).

I would probably go for a mingw static build if I had to attempt this.

Regards,
Martin
Feb 12 '06 #9
Thomas Heller wrote:
I wonder if anyone is actually using freeze on Windows, with scripts
that use, say, pywin32 and wxPython.


Interesting question. I've never done so myself (only on Linux and
Solaris), and given the relatively small interest in having a static
Python library on Windows, I guess the answer is no (or: everybody
doing that has managed to deal with the build process themselves).

I would probably go for a mingw static build if I had to attempt this.

Regards,
Martin
Feb 12 '06 #10
In article <ma***************************************@python. org>,
Thomas Heller <th*****@python.net> wrote:
Feb 13 '06 #11
Cameron Laird wrote:
In article <ma***************************************@python. org>,
Thomas Heller <th*****@python.net> wrote:
.
.
.
Usually the bundle=1 option in py2exe can create a single file exe, but it also
allows to have a separate shared library.zip file, which is useful if
you need more than
one exe-file. With python 2.4, MSVCR71.dll is still required and not

.
.
.
For some of our projects, we provide a single executable, which
takes a command-line argument (or, rarely, environment variable)
to tell the executable whether to come up as server or client,
or GUI or command-line version, or ... The result is that, even
for an architecturally-sophisticated development, the end-user
experiences a unitary delivery; he has just one file to install,
remove, archive, ...


Ok, so you're down to about 0.2 files per application ;-)

Thomas

Feb 13 '06 #12
Kevin Walzer wrote:
Which of the Windows/Unix package builders for Python applications is
capable of creating single-file executables? I'm thinking of:

1. py2exe
2. Mcmillan Installer/PyInstaller
3. cxfreeze

The apps I've seen created by py2exe aren't single-file at all, the
install folder is full of files besides the main program. I'm looking
for a solution that stuffs all libraries, scripts, and the Python
runtime into one file.


I use py2exe and Inno Installer and get to a single file installation
that way. Inno creates setup.exe as a single file. That file may
actually expand into several files upon installation (which is
typical as you want readme.txt, history.txt, other documentation,
maybe example .ini file, etc.). IMHO the fact that py2exe doesn't
create a single exe is a non-problem. What other Windows app when
installed only installs <progname>.exe and NO OTHER FILES. Inno
solves the problem of only having a single .exe to DISTRIBUTE
which I think is the real goal. Inno also lets you automate the
creation of desktop/quicklaunch/startbutton icons, insertion of
items into the registry, and a whole host of other "stuff" that
normally must be done to complete a proper installation. With some
plug-ins, you can even have it get updates from a website (I have
not tested this, but I've read about it).

If you want to "obscure" your programs use the bundle option and
py2exe imbeds the .ZIP file inside the .EXE file (making it
somewhat harder to hack).

-Larry Bates
Feb 13 '06 #13
Larry Bates wrote:
Kevin Walzer wrote:
Which of the Windows/Unix package builders for Python applications is
capable of creating single-file executables? I'm thinking of:

1. py2exe
2. Mcmillan Installer/PyInstaller
3. cxfreeze

The apps I've seen created by py2exe aren't single-file at all, the
install folder is full of files besides the main program. I'm looking
for a solution that stuffs all libraries, scripts, and the Python
runtime into one file.


I use py2exe and Inno Installer and get to a single file installation
that way. Inno creates setup.exe as a single file. That file may
actually expand into several files upon installation (which is
typical as you want readme.txt, history.txt, other documentation,
maybe example .ini file, etc.). IMHO the fact that py2exe doesn't
create a single exe is a non-problem. What other Windows app when
installed only installs <progname>.exe and NO OTHER FILES. Inno
solves the problem of only having a single .exe to DISTRIBUTE
which I think is the real goal. Inno also lets you automate the
creation of desktop/quicklaunch/startbutton icons, insertion of
items into the registry, and a whole host of other "stuff" that
normally must be done to complete a proper installation. With some
plug-ins, you can even have it get updates from a website (I have
not tested this, but I've read about it).

If you want to "obscure" your programs use the bundle option and
py2exe imbeds the .ZIP file inside the .EXE file (making it
somewhat harder to hack).

-Larry Bates


It's not so much for "obscurity" as simplicity.

Tcl/Tk allows you to pack everything into a single file: it's called a
"starpack." You can use an installer, but it's not necessary--the file
can be uninstalled by moving it to the recycle bin.

On Mac OS X, applications are typically deployed as a "bundle"--the .app
extension is actually a directory that looks like a single file. All the
libraries, etc. can be placed inside.

The install directories that are created by py2exe, at least the ones
I've seen in the past, seem messy by comparison. As I understand it, the
latest version allows you to do "one-file-deployment," which is what I'm
looking for. PyInstaller also does this, from what I'm told.

So, I'm interested in that type of functionality.

--
Kevin Walzer
iReveal: File Search Tool
http://www.wordtech-software.com
Feb 13 '06 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: sinister | last post by:
The examples in the online manual all seem to use double quotes, e.g. at http://us3.php.net/preg_replace Why? (The behavior is different with single quotes, and presumably simpler to...
12
by: Dennis Plöger | last post by:
Hi all! I'm currently having some problems parsing a char array in c++. (And yes, I'm a half-newbie ;-)) Perhaps you can help me with this: #include <iostream> using std::cout; void...
5
by: Joel | last post by:
Hi, I incorporated a function in my code that whenever I use a string variable in an sql statement if the string contains a single quote it will encase it in double quotes else single quotes. ...
3
by: Jason | last post by:
I have several tables with quite a few fields and I'm getting errors when trying to insert records with single quotes in the data like: name = John O'Henry or a city name of O'Fallen So I went...
11
by: Thom Little | last post by:
I would like three states on an icon ... Left Click Right Click Double Click Left Click is fired at least once on a Double Click Is there a good example that shows how to determine if the...
3
by: R Millman | last post by:
under ASP.NET, single stepping in debug mode appears not to stop within event procedures. i.e. 1) Create web page with submit button and event procedure for the click event in the code behind...
2
by: John Dann | last post by:
I'm retrieving some columns from a database with numeric values that fall comfortably within the range of the Single type and I'm tempted to use Single for the relevant column type in the retrieved...
9
by: MrSpock | last post by:
1. Create a new Windows Application project. 2. Open the project properties and check "Make single instance application". 3. Build. 4. Go to the release folder and run the application. 5. Try to...
3
by: Eric Layman | last post by:
Hi, I've saved data into the db by doing a replace() on single quote. Right now on data display on a datagrid, it shows double single quote. How do I make changes during run time of datagrid...
2
by: Reporter | last post by:
I got the following example from http://www.evolt.org/article/User_Friendly_Forms_in_PHP/20/60144/index.html : echo '<tr><td>First name:</td><td><input type="text" name="first_name"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.