嗨,我有以下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']
我尝试了所有可用的堆栈溢出解决方法,但是它们都没有起作用,任何建议都会对您有所帮助。
答案 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},