导入tkinter错误

时间:2017-02-14 16:45:38

标签: python tkinter build exe cx-freeze

The Error I receive when I try to open the exe file.

我有一个.py文件,我试图将其转换为exe。我已尝试使用cx_Freeze多次尝试构建此文件,但每次都会遇到相同的错误。

我听说它与cx_Freeze有关,所以我卸载了cx_Freeze并使用pip install cx_freezexxxx.whl wheel重新安装了它,但仍然没有&#39}工作。我通过在命令行中编写python setup.py build来构建我的exe。这是我的设置.py代码。

import cx_Freeze
import sys

import os
os.environ['TCL_LIBRARY'] = "C:\\Users\\louisa\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "C:\\Users\\louisa\\tcl\\tk8.6"


base = None

if sys.platform == 'win32':
    base = "Win32GUI"

executables = [cx_Freeze.Executable("filemakergui.py", base=base, icon="Treetog-I-Documents.ico")]

cx_Freeze.setup(
    name = "ALT File Maker",
    options = {"build_exe": {"packages":["tkinter"], "include_files":["Treetog-I-Documents.ico", "Hopstarter-Sleek-Xp-Basic-Help.ico", "Custom-Icon-Design-Flatastic-2-Success.ico"]}},
    version = "0.01",
    description = "ALT File Maker",
    executables = executables
)

我在setup.py文件中写的内容有什么问题吗?我已经好几天坚持这个问题了。有关解决此类问题的任何提示吗?

0 个答案:

没有答案