1
我想在Windows中使用我在Linux中開發的python製作一個exe文件。該程序在Windows下運行在python上,當我使用cxfreeze時,它完成並生成exe文件。但是當我運行它時,我得到:Tkinter Cxfreeze錯誤
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
這可能意味着Tcl沒有正確安裝。
因此,我在C:驅動器的Python26目錄中查找init.tcl,並將其複製到它所建議的目錄之一。然後,這給了我這個錯誤:
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"
我似乎在這一點上碰壁,並記住爲什麼我首先切換到Linux。
任何對Windows更熟悉的人的建議?