2017-01-31 85 views
0

,當我試圖隱蔽我的.py文件到一個EXE我得到的命令提示符下此錯誤時:錯誤轉換.py文件到exe

[Errno 2] No such file or directory: 'C:\\Program Files\\Python35\\tcl\\tcl8.6'

這是我的setup.py文件的代碼:

from cx_Freeze import setup, Executable 

import os 
os.environ['TCL_LIBRARY'] = "C:\\Program Files\\Python35\\tcl\\tcl8.6" 
os.environ['TK_LIBRARY'] = "C:\\Program Files\\Python35\\tcl\\tk8.6" 

setup (name = 'CODAQ Beta', version = '0.1', description = 'Aerosol Data Visualization Environment', executables = [Executable("CODAQ.py")]) 

我聽說,可能我要改變os.environ['TCL_LIBRARY']os.environ['TK_LIBRARY']依賴的tcl8.6tk.86在我的系統路徑上。有關如何做到這一點的任何提示?

+0

是'tcl8.6'在'C:\\ Program Files文件\\ Python35 \\ \\ TCL'? – tburrows13

回答

1

找到了解決辦法:

TCL竟是Anaconda3:

這裏是我改變了代碼:

from cx_Freeze import setup, Executable 

import os 
os.environ['TCL_LIBRARY'] = "C:\\Program Files\\Anaconda3\\tcl\\tcl8.6" 
os.environ['TK_LIBRARY'] = "C:\\Program Files\\Anaconda3\\tcl\\tk8.6" 

setup (name = 'CODAQ Beta', version = '0.1', description = 'Aerosol Data Visualization Environment', executables = [Executable("CODAQ.py")])