py2exe - create one EXE

C

codecraig

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
 
F

Fredrik Lundh

codecraig said:
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/theller/moin.cgi/SingleFileExecutable

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

</F>
 
C

codecraig

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.
 
C

codecraig

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?
 
C

codecraig

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?
 
J

James Carroll

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
 
C

codecraig

So how there is currently available way to have 1 .exe which includes
everything needed to run a python app?

:sigh:
 
F

Fredrik Lundh

James said:
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>
 
C

codecraig

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
 

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
474,234
Messages
2,571,180
Members
47,813
Latest member
RustyGary3

Latest Threads

Top