16

After some big frustration I did it! I converted my django app to an "exe" one to run as a single standalone app on windows (using cherrypy as a WSGI server) But When I try to to set py2exe's option "bundle_files" to "1" (i.e. bundle the python interpreter Python25.dll inside the generated exe) the generated exe crashes with a message talking about kernel32.dll

But when I use "bundle_file" = "2", the generated exe is runing like a charm, but must -of course- have Python25.dll as a separate file beside it.

Anyone experienced a similar behavior, can you please tell me what I'm missing?

Thank you! :)

AShelly
  • 34,686
  • 15
  • 91
  • 152
sandra
  • 450
  • 1
  • 5
  • 18
  • Oh shoot, I know I had this problem before, but can't remember what the heck I did to fix it. :( Sorry dude. I'll return if I remember. – Aren May 26 '10 at 00:01
  • 3
    Dude? :) -- Thanks, Aren! Please do tell me when you remember how/why! – sandra May 26 '10 at 11:06
  • I'm having a similar problem, but the exe crashes if I set bundle_files to 1 or 2. Only 3 works. Mine is a Tkinter GUI utility. py2exe-0.6.9.win32-py2.6. I've tried some googling and found reports of similar problems, but no fixes so far. – Simon Hibbs Jun 30 '10 at 14:43
  • Could you provide the error message (mentioning kernel32.dll) please? – aknuds1 Feb 26 '11 at 23:36
  • 3
    you probably mean "bundle_files": 1, not "bundle_files"= "1" nor "bundle_file" = "1". right? – joaquin Mar 08 '11 at 19:15
  • 2
    Are you using windows 64bit? because "bundle_file" to "1" is not supported for 64 bits machines – P2bM Mar 30 '11 at 16:21

4 Answers4

2

this post talks all about using py2exe to get a single exe file.

py2exe - generate single executable file

If you post some code i'll take a look, and your error message will help to.

Community
  • 1
  • 1
Nor
  • 115
  • 1
  • 4
1

I also faced similar problem. But mine is with PyGTK. Simple program has no problem with it. Although there is no straight solution, there is an explanation provided here.

It says:

This is based on the Inno sample code in the py2exe distribution. It has worked successfully for a rather complicated PyGTK/Twisted app requiring extra data at runtime (GTK runtime data, GtkBuilder files, images, text data) that just wouldn't work with bundle_files.

elwc
  • 1,197
  • 2
  • 15
  • 25
1

Maybe you can try pyinstaller instead.

I did have this problem before and didn't find a solution ever, but pyinstaller meets my need too and works perfectly.

Felix Yan
  • 14,841
  • 7
  • 48
  • 61
0

Here's The solution:

from distutils.core import setup
import py2exe, sys, os

sys.argv.append('py2exe')

setup(
    options = {'py2exe': {'bundle_files': 3}},
    windows = [{'script': "Your_App_Name.py"}],
    zipfile = None,
)
belkacem mekakleb
  • 584
  • 2
  • 7
  • 22