开发者

Tkinter Cxfreeze Error

I'm trying to make an exe in Windows out of python I developed in Linux. The program works on it's own in python under Windows, and when I use cxfreeze it completes and makes 开发者_StackOverflowthe exe. However when I run it I get:

C:\projects\0802001S\dist>listen.exe
Traceback (most recent call last):
  File "C:\Python26\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27
, in <module>
    exec code in m.__dict__
  File "./listen.py", line 425, in <module>
  File "C:\Python26\lib\lib-tk\Tkinter.py", line 1643, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, want
objects, useTk, sync, use)
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
    C:/projects/0802001S/lib/tcl8.5 C:/projects/0802001S/lib/tcl
8.5 C:/projects/lib/tcl8.5 C:/projects/0802001S/library C:/projects/libr
ary C:/projects/tcl8.5.9/library C:/tcl8.5.9/library

This probably means that Tcl wasn't installed properly.

So, I then looked for init.tcl in my Python26 directory in my C: drive, and copied it to one of the directories it suggested. Which then gave me this error:

C:\projects\0802001S\dist>listen.exe
Traceback (most recent call last):
  File "C:\Python26\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27
, in <module>
    exec code in m.__dict__
  File "./listen.py", line 425, in <module>
  File "C:\Python26\lib\lib-tk\Tkinter.py", line 1643, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, want
objects, useTk, sync, use)
_tkinter.TclError: invalid command name "tcl_findLibrary"

I seem to have hit a wall at this point and remember why I switched to Linux in the first place.

Any suggestions from someone who's more familiar with Windows?


I just ran into something similar. The conclusion I have so far is to copy both tcl8.5 and tk8.5 into the directory where you're running listen.exe (dist/build dir).

I was also on the cx_freeze mailinglist and there was mentioning about the hook possibly only running on Unix since it was never tested in Windows as of this current build (12/29/10)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜