cx_冻结 MSI 错误

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

我已成功将 python 文件编译为 cx_Freeze,但是当我单击该应用程序时,出现以下错误:

error image link

这是我的

setup.py

import sys
from cx_Freeze import setup, Executable

company_name = 'Vagif Programs'
product_name = 'BananaCell'

bdist_msi_options = {
    'upgrade_code': '{66620F3A-DC3A-11E2-B341-002219E9B01E}',
    'add_to_path': False,
    'initial_target_dir': r'[ProgramFilesFolder]\%s\%s' % (company_name, 
product_name),
    }

build_exe_options = {
    'includes': ['tkinter', 'tkinter.filedialog', 'openpyxl.utils'],
    }


base = None
if sys.platform == 'win32':
    base = 'Win32GUI'


exe = Executable(script='comparing.py',
                 base=base,
                 icon='icon.ico',
                 shortcutName='BananaCell',
                 shortcutDir='DesktopFolder'
                )



setup(name=product_name,
      version='1.0.0',
      description='blah',
      executables=[exe],
      options={
          'bdist_msi': bdist_msi_options,
          'build_exe': build_exe_options})

有人可以帮助我吗?任何帮助将不胜感激。

python windows-installer cx-freeze
1个回答
0
投票

根据错误信息,

comparing.py
的第1行出了问题。具体来说,Python 找不到名为
_fix_up_module
的东西。

如果您的脚本 (

comparing.py
) 在打包之前运行时正常运行且没有错误,则错误可能是由于某些依赖项未包含在您构建的可执行文件中而引起的。如果此依赖项是一个模块,那么您需要使用类似
setup.py
选项在
include_files
中声明它。

https://cx-freeze.readthedocs.io/en/latest/setup_script.html

include_files

包含要复制到目标目录的文件的列表;预计该列表将包含源和目标的字符串或二元组;源可以是文件或目录(在这种情况下,将复制树,但 .git、.svn 和 CVS 目录除外);目标不能是绝对路径

© www.soinside.com 2019 - 2024. All rights reserved.