有关将规范(python)转换为带有图像的exe文件的错误

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

当我想将我的规范文件转换为 exe(使用 pyinstaller)时,我在命令窗口中看到了这个错误。 我使用 python 3.9 TypeError: Expected tuple, not list.

和我的规格文件

# -*- mode: python ; coding: utf-8 -*-


block_cipher = None


a = Analysis(['e1.py'],
    pathex=['C:\\Users\\Sazgar\\Desktop\\e1'],
    binaries=[],
    datas = [],
    hiddenimports=[],
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[],
    win_no_prefer_redirects=False,
    win_private_assemblies=False,
    cipher=block_cipher,
    noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

a.datas += [('I.png','C:\\Users\\Sazgar\\Desktop\\I.png','DATA')],


exe = EXE(
    pyz,
    a.scripts,
    [],
    exclude_binaries=True,
    name='e1',
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    console=True,
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
)
coll = COLLECT(
    exe,
    a.binaries,
    a.zipfiles,
    a.datas,
    strip=False,
    upx=True,
    upx_exclude=[],
    name='e1',
)

我该如何解决? 我走这个步骤 1.e1.py转exe 2.规格编辑 3.spec to exe(报错)

python pyinstaller exe specifications
© www.soinside.com 2019 - 2024. All rights reserved.