我試圖將使用.png圖像的GUI程序轉換爲使用py2exe的.exe。它使用PIL來顯示這些圖像。但是,我在轉換時遇到了麻煩。由於某些原因,它使得.exe不會運行。有任何想法嗎?PIL和py2exe的問題
編輯
錯誤:
Traceback (most recent call last):
File "GUI1.2.8.py", line 454, in <module>
File "GUI1.2.8.py", line 13, in __init__
File "Tkinter.pyc", line 1643, in __init__
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
{C:/Users/rectangletangle/lib/tcl8.5} {C:/Users/rectangletangle/lib/tcl8.5} C:/Users/lib/tcl8.5 {C:/Users/rectangletangle/library} C:/Users/library C:/Users/tcl8.5.8/library C:/tcl8.5.8/library
This probably means that Tcl wasn't installed properly.
的錯誤似乎是完全無關的(如果我做什麼毛病py2exe,這是錯誤我通常會)。一切,工作,直到我導入和使用PIL。另外,我在我的設置文件中包含了PIL。
編輯2
這是顯示我是如何實現圖像的一個片段。
self.image = ImageTk.PhotoImage(Image.open("image.png"))
self.imageLabel = Tkinter.Label(self, image=self.image)
self.imageLabel.grid(column=0, columnspan=4, row=0)
什麼是錯誤?你是否在'setup.py'文件中包含'PIL'模塊? – user225312 2010-11-17 08:15:21
查看我的編輯信息。 – rectangletangle 2010-11-17 08:20:15