Search code examples
pythonexcelcx-freezexlwt

cx_Freeze: cannot input ExcelFormulaParser


So I am trying to compile my code into an .exe using cx_freeze.

Here is the code I am using to compile it...

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

The code compiles enter image description herewith no errors. When I go to run the .exe the program launches and closes with this error.

I notice that it does not like something inside xlwt module ExcelFormulaParser By I do not know what the error is.

any suggestions?


Solution

  • Try to add xlwt library to setup options, i.e.

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