Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 将kivy文件转换为可执行文件_Python_Windows_Kivy_Exe - Fatal编程技术网

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。然后查看应用程序生成的任何输出。