473,662 Members | 2,551 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

py2exe - create one EXE

Hi,
Is there a way to create one .exe using py2exe (or some other
extension/utility that can do it)?

Basically i want to generate one .exe that contains everything my
python app needs to run instead of having a .exe, some .zips, etc.

thanks

Jul 19 '05 #1
9 1785
"codecraig" wrote:
Is there a way to create one .exe using py2exe (or some other
extension/utility that can do it)?

Basically i want to generate one .exe that contains everything my
python app needs to run instead of having a .exe, some .zips, etc.


hmm. if you cannot access google, how come you're able to post via
google groups?

here's the first google hit for "py2exe single exe"

http://starship.python.net/crew/thel...FileExecutable

(that page also happens to be linked from the front page on the py2exe
support wiki)

</F>

Jul 19 '05 #2
must have missed it on py2exe front page....and for google i didnt try
that search exactly. Thanks though. I was trying like "one executable
py2exe", etc.

Jul 19 '05 #3
yeah, the question does come up once a month at least, but you could
try mcmillan installer with it's --onefile option.

i have mirrors at http://www.the-jedi.co.uk/downloads/installer

Jul 19 '05 #4
I tried the installer v6...and i generated a spec, and i built the
exe...when i run the exe i get a error popup window from Windows asking
me to send an Error report.

The warnings that were generated during the build all appear to be
"ignorable" as the documentation mentions.

any ideas?

Jul 19 '05 #5
oh and Fredrik, i tried the SingleInstaller link....which points to a
script using NSIS. I followed those instructions which generated an
..exe. HOwever, when i run the .exe nothing happens (meaning no
process starts, no output, no errors, nothing).

any ideas on that? have ever used it?

Jul 19 '05 #6
I like that you can automatically invoke NSIS and create an installer,
but I thought the question was how can all of the libraries be in a
single runnable program executable (not a program that installs, but
the program that you wrote.)

I don't think you can do this, because (unless you have your own
version of python that statically links with all of the module's
native code that you need) you would have to have some code that loads
DLLs that are packed in your executable at the moment that the import
happens for that module.

Please correct me if I'm wrong, I'd love to minimize the files that
have to be in the same directory as my executable (or nearby, or in a
common lib dir.)

(sorry you got this twice Craig.)

-Jim
Jul 19 '05 #7
So how there is currently available way to have 1 .exe which includes
everything needed to run a python app?

:sigh:

Jul 19 '05 #8
James Carrol wrote:
I like that you can automatically invoke NSIS and create an installer,
but I thought the question was how can all of the libraries be in a
single runnable program executable (not a program that installs, but
the program that you wrote.)
the wiki recipe does exactly that -- it creates one EXE, which *temporarily*
unpacks the components that have be in separate files for Windows to find
them. when you terminate the program, the files are removed.
I don't think you can do this, because (unless you have your own
version of python that statically links with all of the module's
native code that you need) you would have to have some code that loads
DLLs that are packed in your executable at the moment that the import
happens for that module.


there are commerical libraries available that overrides Win32 API calls
so they fetch data from resources rather than disk files. but given that
disks are fast and disk space is cheap, it's hardly worth the effort.

</F>

Jul 19 '05 #9
fredrik...

any ideas on my last post? (copied below for u)

oh and Fredrik, i tried the SingleInstaller link....which points to a
script using NSIS. I followed those instructions which generated an
..exe. HOwever, when i run the .exe nothing happens (meaning no
process starts, no output, no errors, nothing).

any ideas on that? have ever used it?

thanks

Jul 19 '05 #10

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

Similar topics

0
2983
by: RJS | last post by:
Hi all, I can't get a py2exe compiled app to run with numarray (numarray-0.5.win32- py2.2). Also wxPythonWIN32-2.3.3.1-Py22 and ActivePython-2.2.1-222. In the sample below, commenting out "import numarray" allows the exe to run. Left in, I get "4.exe has generated errors" etc. I'm going around and around and there isn't much on Google. py2exe output is last.
2
3352
by: Stefan Behrens | last post by:
Hi, does anybody know how I can get py2exe to work with wxPython's wxCalendarCtrl? Currently, I have just a "standard" setup.py, and py2exe gives me a syntax error. Do I need to include any special extension and how? Below is the output I get as well as a small demo app to reproduce the problem.
0
1709
by: Kathleen Kudzma | last post by:
I'm having a problem with py2exe for Python 2.3. I got fixed the Lookuperror no codec search functions registered: can't find encoding by following the instructions on the py2exe page (added -packages encodings --force-imports encodings). This resolved the codec error. When I tried to create an exe with py2exe I still got the following warnings. Please see the new error I got (after warnings). ...
8
4731
by: Kathleen Kudzma | last post by:
Does anyone know how to resolve the following problem that I'm getting in Python 2.2 and 2.3? PROBLEM: When I try to create a classReader object I get an exception: "SAXReaderNotAvailable: No parsers found". This only happens when I run the ..EXE; it does not happen if I run the .PY file. When I'm running the .EXE this exception doesn't happen immediately. It happens as soon as I try to create a classReader object. Please see the...
6
3942
by: Luc Saffre | last post by:
Hello, I had a strange problem when freezing (using either py2exe or McMillan installer) a script that imports reportlab (which imports PIL (which imports FixTk))). - Python 2.3.3c (also with Python 2.3) - PIL 1.1.4 - Installer or py2exe : latest versions.
1
2586
by: Funduk | last post by:
Hello, So I've been playing with Python and Pygame for a while and I decided I wanted to make a real executable so I could send that stuff over to my friends to show off my <sarcasm>maad skillz</sarcasm>. Everything was going great I went and got all the newest software (including Distutils and PY2EXE) and read the docs on making a setup py.
0
2582
by: David Vaughan | last post by:
py2exe and Pmw problem ---------------------- I was really surprised not to find some faq setting out what to do to get py2exe working for a program using Pmw. I'm haemorrhaging time here, and I'm now just after step-by-step guidance on using py2exe and Pmw together. I wasn't expecting this to take hours... I've used py2exe succesfully on non-gui programs, and the Python program
1
338
by: mitsura | last post by:
Hi, I just installed py2exe to create a binary of my Python script. However, py2exe does not seem to create a binary from my .py script. This is what I have done: I create a setup.py script: " # setup.py from distutils.core import setup import py2exe
4
4003
by: bwaha | last post by:
First time trying to create an executable with py2exe. I have a small program which makes use of python23 (2.3.5?), wxpython ('2.6.2.1'), matplotlib ('0.83.2'), win32com (latest?), Numeric ('23.7') on Windows XP & Win2000. The program runs without problem but as an exe it doesn't even get to showing the GUI. I get the following error log when I run the executable. Traceback (most recent call last): File "mpival3.py", line 1264, in ?
4
34840
true911m
by: true911m | last post by:
Here's a little walkthrough to get py2exe up and running. I'm not an expert, so I can't help much with any problems you might have. This is what worked for me. The result here will be to convert a simple python app into a single .exe file that can be copied and run on any Windows XP machine. It may work on many other Windows platforms, but I haven't tested it. You'll need a working Python installation first, preferably v2.3 or later. ...
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8546
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7367
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5654
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.