rectangletangle rectangletangle - 1 year ago 135
Python Question

Problems with Tkinter in py2exe

I made a a simple GUI program in python with tkinter and attempted to convert it to an .exe using py2exe. However, I've run into a problem. When I try to run the exe it flashes an error very quickly then disapears. So the best I could do was take a screan shot of the error.

How do I go about fixing this?

alt text


Velociraptors, this is my setup file. It's about as basic as it can be. How would I go about integrating init.tcl into the code?

from distutils.core import setup
import py2exe

setup(console=[r'C:\Python26\Random Password'])

Answer Source

Does your script include init.tcl in the data_files option? The py2exe list of options says that's how you should include images and other required data files.


Your setup script specifies that your program should be converted to a console exe. If you want a GUI program (which you do, since you're using Tkinter), you need to use the windows option:

setup(windows=[r'C:\Python26\Random Password'])

Py2exe should correctly include Tkinter's dependencies. If not, you can manually include init.tcl:

      windows=[r'C:\Python26\Random Password'])
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download