cx_Freeze无法使用熊猫构建MSI

时间:2019-02-22 12:00:59

标签: python pandas cx-freeze

嗨,我有以下cx_Freeze .Includes()文件用于使用以下应用程序 .Load()模块。生成setup.py时,我遇到了问题。我在Google各处搜寻了此内容,但没有一个对我有用。

pandas

当我使用msi构建include-files = ['aardvark.dll'] includes = [] excludes = [] base = "Win32GUI" exe = Executable( script="test.py", initScript=None, base=base, targetName="test.exe", copyDependentFiles=True, compress=False, appendScriptToExe=False, appendScriptToLibrary=False, shortcutDir="MyProgramMenu", shortcutName=APP_NAME) bdist_msi_options = { "upgrade_code": UPGRADE_CODE, "add_to_path" : False} setup( name=APP_NAME, version=VERSION, author="sri", description='test Tool', options={"build_exe": {"excludes":excludes, "includes":includes, "include_files":includefiles}, "bdist_msi" : bdist_msi_option}, executables=[exe]) 时, 此错误:

  

cx_Freeze.freezer.ConfigError:没有名为sys的文件(用于模块collections.sys)

当我使用msi时,会创建cx_Freeze==4.3.4,但安装后会显示

  

ImportError:缺少必需的依赖项['numpy']

enter image description here

我尝试了所有可用的堆栈溢出解决方法,但是它们都没有起作用,任何建议都会对您有所帮助。

1 个答案:

答案 0 :(得分:0)

pandas取决于numpy,您需要将numpy显式添加到packages选项的build_exe列表中,以便cx_Freeze正确包含了numpy,请参见Creating cx_Freeze exe with Numpy for Python

尝试将以下内容添加到设置脚本中

packages = ['numpy']

,并根据

修改options
options={"build_exe": {"excludes":excludes,
                       "includes":includes,
                       "include_files":includefiles,
                       "packages":packages},
         "bdist_msi" : bdist_msi_option},