【发布时间】:2018-07-03 17:07:41
【问题描述】:
我创建了一个我正在尝试编译的程序,但是在编译完成后我尝试从 /dist/ 目录中的 .exe 启动应用程序,它会创建一个命令提示符窗口,打开应用程序窗口片刻,然后关闭。
我已按照 Kivy 程序添加正确的导入,并将必要的目录添加到规范的 COLLECT 区域。我尝试将 pyinstaller 钩子导入添加到顶部,正如一些人在各个页面上推荐的那样,但无济于事。
应用程序在测试过程中通过命令“python main.py”正常启动,所以我很困惑为什么它在编译后没有启动。
规格:
# -*- mode: python -*-
from kivy.deps import sdl2, glew
block_cipher = None
a = Analysis(['..\\main.py'],
pathex=['C:\\python programs\\Escape Room Program\\compiled'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
**get_deps_all())
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='EskapAid',
debug=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe, Tree('..\\compiled'),
a.binaries,
a.zipfiles,
a.datas,
Tree('..\\img\\', 'img'),
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
strip=False,
upx=True,
name='EskapAid')
我不介意在必要时提供任何其他信息,包括我可能采取的其他步骤,但目前,我很困惑为什么它没有正确启动。
【问题讨论】:
标签: python kivy pyinstaller