algorithm6
2022-05-15 21:41
采纳率: 69.2%
浏览 39

python打包出错

本人用pyi-makespec main.py方法,生成main-spec文件:

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


block_cipher = None


a = Analysis(
    ['C:\\Users\\LENOVO\\PycharmProjects\\pythonProject\\work1\\alien_invasion.py',
    'C:\\Users\\LENOVO\\PycharmProjects\\pythonProject\\work1\\alien.py',
    'C:\\Users\\LENOVO\\PycharmProjects\\pythonProject\\work1\\bullet.py',
    'C:\\Users\\LENOVO\\PycharmProjects\\pythonProject\\work1\\button.py',
    'C:\\Users\\LENOVO\\PycharmProjects\\pythonProject\\work1\\game_stats.py',
    'C:\\Users\\LENOVO\\PycharmProjects\\pythonProject\\work1\\scoreboard.py',
    'C:\\Users\\LENOVO\\PycharmProjects\\pythonProject\\work1\\settings.py',
    'C:\\Users\\LENOVO\\PycharmProjects\\pythonProject\\work1\\ship.py'],
    pathex=[],
    binaries=[],
    datas=[('C:\\Users\\LENOVO\\PycharmProjects\\pythonProject\\work1\\images\\ship.png','ship.png'),
    ('C:\\Users\\LENOVO\\PycharmProjects\\pythonProject\\work1\\images\\alien.png','alien.png')],
    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)

exe = EXE(
    pyz,
    a.scripts,
    [],
    exclude_binaries=True,
    name='alien_invasion',
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    console=False,
    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='alien_invasion',
)


然后用pyinstaller main.spec制作exe
结果如下:

img

img


请问是什么问题,要怎么修改?

3条回答 默认 最新

相关推荐 更多相似问题