Python 将kivy文件转换为可执行文件
我试着用下面的问题回答,但对我不起作用。 我执行的第一个命令是Python 将kivy文件转换为可执行文件,python,windows,kivy,exe,Python,Windows,Kivy,Exe,我试着用下面的问题回答,但对我不起作用。 我执行的第一个命令是pyinstaller--onefile-y--clean--windowed--name launcher--exclude module\u tkinter--exclude module tkinter--exclude module enchant--exclude module twisted C:/Users/Karl/Documents/aaaSpaceCRAFT/launcher/main.py 然后我编辑等级库文件,
pyinstaller--onefile-y--clean--windowed--name launcher--exclude module\u tkinter--exclude module tkinter--exclude module enchant--exclude module twisted C:/Users/Karl/Documents/aaaSpaceCRAFT/launcher/main.py
然后我编辑等级库文件,使其看起来像这样
# -*- mode: python -*-
from kivy.deps import sdl2, glew
block_cipher = None
a = Analysis(['C:/Users/Karl/Documents/aaaSpaceCRAFT/launcher/main.py'],
pathex=['C:\\Users\\Karl\\Documents\\aaaSpaceCRAFT\\launcher'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=['_tkinter', 'Tkinter', 'enchant', 'twisted'],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
a.datas += [('launcher.kv', 'C:/Users/Karl/Documents/aaaSpaceCRAFT/launcher/launcher.kv', 'DATA')]
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='launcher',
debug=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=False )
然后运行以下命令python-m PyInstaller myapp.spec
但每当我尝试运行exe时,它就会打开并立即关闭。我已经通过命令行运行了它,没有给出任何错误
任何帮助都将不胜感激。我似乎没有完全回答我链接的堆栈溢出问题。一旦我这样做了,它就开始工作。尝试将
console=False
更改为console=True
,然后重新运行pyinstaller。然后查看应用程序生成的任何输出。