我有以下项目结构: 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')
然而,应用程序只是立即启动和关闭,我找不到问题
答案 0 :(得分:0)
问题是我没有添加“sqlite3”,它包含在模型包中,我认为它不能用于分析以及我已将.kv文件添加为数据,因为它标记为无
datas = None ---> datas = [('/ package / file.something','编译后'目的文件夹')]