Rohan K. Rohan K. - 1 year ago 162
Python Question

Py2exe, Tkinter, and Setup File Problems?

I just finished creating a python program in 2.7 and I converted it to a


Everything works fine when I run the converted executable file in the folder I placed it in with all of the images in it. After converting the python program to
, I proceeded to creating a
file for it. I added all of the files associated with my project including
in the
file. I added pretty much everything that let me run the executable.

Once I finished creating the
file, I opened it. I went through everything and finished installing it on my system and created a shortcut on my
. When I tried to open it, it would not work. Instead of running the program, it tells me to open a log file in its folder in the Program Files. When I open the log file, I noticed an error. How do I fix this?


Traceback (most recent call last):
File "", line 10, in <module>
File "Tkinter.pyc", line 1764, in __init__
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
{C:/Program Files (x86)/lib/tcl8.5} {C:/Program Files (x86)/lib/tcl8.5} C:/lib/tcl8.5 {C:/Program Files (x86)/library} C:/library C:/tcl8.5.15/library C:/tcl8.5.15/library

This probably means that Tcl wasn't installed properly.

Answer Source

I found a bug on the virutalenv site which suggested the following

I imagine that you are encountering the same issue just without virtualenv the following set the correct paths which can then be included in the application please find the right path to TCL and TK for your python version

set "TCL_LIBRARY=C:\Python27\tcl\tcl8.5" 
set "TK_LIBRARY=C:\Python27\tcl\tk8.5" 

restart your cmd or shell

I believe that the TCL location have changed from there default ones.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download