世界各地的人们,
我刚刚完成了一个项目,并希望能够将它变成一个exe文件进行分发。
问题是我每次尝试使用cx_freeze来构建它时,在启动EXE时我会收到以下错误消息: -
Traceback(most recent call last):
File "C:\Python34\lib\site-packages\cx_Freeze\initscripts\Console.py",line 27, in <module>
exec(code,m.__dict__)
File"calculator.py",line 1, in <module>
file"c:\Python\64bit\3.4\lib\importlib\_bootsrap.py",line2214,in_fine_and_load
可能是错误消息中最相关的部分: - `AttributeError:&#39;模块&#39;对象没有属性&#39; fix_up_module&#39;
我的设置脚本是这样的。
from cx_Freeze import setup, Executable
includefiles = ['prices.dat','raftlogomain.gif'] # include any files here that you wish
includes = []
excludes = []
packages = []
exe = Executable(
script = "calculator.py",
initScript = None,
base = 'Win32GUI',
targetName = "Glass Calculator.exe",
copyDependentFiles = True,
compress = True,
appendScriptToExe = True,
appendScriptToLibrary = True,
icon = None
)
setup(
name = "Glass Calculator",
version = "0.1",
description = 'Bespoke Calculations',
author = "Lewis Tabone",
author_email = "lewis@raftfurniture.co.uk",
options = {"build_exe": {"excludes":excludes,"packages":packages,
"include_files":includefiles}},
executables = [exe]
)
这很简单。
它真气,因为我无法做任何事情,有人必须得到答案!
非常感谢提前!