Python使用Cx_freeze进入MSI Exe,错误消息

时间:2014-08-18 16:00:40

标签: python python-3.x cx-freeze

世界各地的人们,

我刚刚完成了一个项目,并希望能够将它变成一个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]
)

这很简单。

它真气,因为我无法做任何事情,有人必须得到答案!

非常感谢提前!

1 个答案:

答案 0 :(得分:2)

重新发布作为答案:这是known bug由cx_Freeze构建,其中使用的是与您使用的Python 3.4不同的错误修复版本。

this site重新安装cx_Freeze。这是用新版本的Python重新编译的,修正了错误。