【发布时间】:2017-10-06 11:37:19
【问题描述】:
我在 python 中有一个程序,我想使用 cx_Freeze 将其转换为 .exe,但它给出了错误,请按照图片操作: Here's the image
这是我的 setup.py 代码
import sys
from cx_Freeze import setup,Executable
import os.path
from tkinter import *
os.environ['TCL_LIBRARY'] = r'C:\Program Files\Python36\tcl\tcl8.6'
os.environ['TK_LIBRARY'] = r'C:\Program Files\Python36\tcl\tk8.6'
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl',
'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')
options = {
'build_exe': {
'include_files':[
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),
],
},
}
base=None
if sys.platform=='win32':
base='Win32GUI'
executables=[
Executable('TABUADATKINTER.py',base=base)
]
buildOptions=dict(
packages=[],
includes=['pygame'],
include_files=[],
excludes=[]
)
setup(
name='Tabuada',
version='1.0',
description='TABUADA',
options=dict(build_exe=buildOptions),
executables=executables
)
如果需要我的程序代码,请告诉我, 请帮帮我,我不知道如何解决这个问题。
【问题讨论】:
标签: python-3.x tkinter cx-freeze