2017-07-25 86 views
0

所以我想编译我的代码到一个.exe使用cx_freeze。cx_Freeze:无法输入ExcelFormulaParser

这里是我使用的编译代码...

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 我不知道错误是什么。

有什么建议吗?

回答

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")]) 
+0

可惜这仍然没有解决问题。我能够通过进入站点包excel forumula解析器并注释错误代码行来解决问题。但这并不理想 –