cx_Freeze无法使用pandas构建msi

问题描述 投票:3回答:1

您好我有一个使用setup.py模块的应用程序的cx_Freeze 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])

当我用msi构建cx_Freeze==4.3.4时,它给出了这个错误:

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

当我使用cx_Freeze >= 5.0.0时,msi已创建,但安装完成后会给出

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

enter image description here

我尝试了所有可用的堆栈溢出工作,但它们都没有工作任何建议将是一个很大的帮助提前感谢。

python pandas cx-freeze
1个回答
0
投票

pandas依赖于numpy,你需要明确地将numpy添加到packages选项的build_exe列表中,以便cx_Freeze包含numpycorrectly,请参阅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},
© www.soinside.com 2019 - 2024. All rights reserved.