cx_Freeze:无法输入ExcelFormulaParser

时间:2017-07-25 17:24:35

标签: python excel cx-freeze xlwt

所以我试图使用cx_freeze将我的代码编译成.exe。

以下是我用来编译它的代码......

from cx_Freeze import setup, Executable
import sys
import numpy.core._methods
import numpy.lib.format
from xlwt import ExcelFormulaParser


additional_mods = ['numpy.core._methods', 'numpy.lib.format']

setup(name='ReconApp',
      version='0.1',
      description='xyz.script',
      options = {'build_exe': {'includes': additional_mods}},
      executables = [Executable("reconciliation_application.py")])

代码编译enter image description here没有错误。 当我去运行.exe程序启动并关闭此错误。

我注意到它不喜欢xlwt模块里面的东西ExcelFormulaParser 我不知道错误是什么。

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

尝试将xlwt库添加到设置选项,即

import sys, os
from cx_Freeze import setup, Executable

build_exe_options = {"packages": ["numpy", "matplotlib", "xlwt"]}

setup(
    name = "App",
    version = "1.0",
    description = "App ...",
    options = {"build_exe": build_exe_options},
    executables = [Executable("App.py", base = "Win32GUI")])