【发布时间】:2021-11-02 00:32:05
【问题描述】:
import sys, os
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
# "packages": ["os"] is used as example only
build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]}
# base="Win32GUI" should be used only for Windows GUI app
base = None
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
include_files = [(os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'), os.path.join('lib', 'tk86t.dll')), (os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'), os.path.join('lib', 'tcl86t.dll'))]
if sys.platform == "win32":
base = "Win32GUI"
setup(
name = "Snake",
version = "0.1",
description = "A Classic Snake Game with a few Modifications!",
options = {"build_exe": include_files},
executables = [Executable("main.py", base=base)]
这就是我正在使用 cx freeze 的 setup.py 代码。尽管当我尝试使用 python setup.py build 运行它时,出现了这篇文章标题中的错误。告诉我是否需要提供更多信息并提前感谢您!
【问题讨论】: