【发布时间】:2016-08-24 23:55:49
【问题描述】:
我有以下项目结构: Image
我正在尝试通过 Pyinstaller 教程 here 生成 .exe 应用程序 我有以下 .spec 文件:
# -*- mode: python -*-
from kivy.deps import glew
block_cipher = None
a = Analysis(['C:\\Users\\Mohamad\\PycharmProjects\\offline_file_archiever\\app\\mai n.py'],
pathex=['C:\\Users\\Mohamad\\PycharmProjects\\offline_file_archiever\\build'],
binaries=None,
datas=None,
hiddenimports=['sqlite3'],
runtime_hooks=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='sample_build',
debug=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe,Tree('C:/Users/Mohamad/PycharmProjects/offline_file_archiever/app/gui'),
a.binaries,
a.zipfiles,
a.datas,
*[Tree(p) for p in glew.dep_bins],
strip=False,
upx=True,
name='sample_build')
但是应用程序只是立即启动和关闭,我找不到问题
【问题讨论】:
-
从命令行运行应用程序。这将向您显示错误。您很可能缺少一些需要包含在
hiddenimports中的文件。 -
我应该在 hiddenimports 中添加什么?
-
@MohamadAlhaddad 看看here
标签: python-2.7 kivy pyinstaller