如何在 Windows 中为桌面创建 kivy 应用程序?

How to create kivy applications for desktop in Windows?

大家下午好。

再次尝试在 WINDOWS 10 上为 DESKTOP 打包 kivy 但无济于事!

我遇到了很多错误,我设法在不影响组内秩序的情况下解决了这些错误,但这一个是带有 ph 的 phoda。

1 - 我使用 Auto_py_to_exe 创建了 exe,在有任何评论说我应该使用 pyinstaller 之前,我告诉你,同样的事情发生了!

2 - 我的pyinstaller脚本如下:

pyinstaller --noconfirm --onefile --console --name "TeuCu" --add-data "C: /Users/Elias/Desktop/kv_inventario/inventario/main.kv ;" --add-data "C:/Users/Elias/Desktop/kv_inventario/inventario/images; images/" "C:/Users/Elias/Desktop/kv_inventario/inventario/main.py"

3 - 错误就是这样,当运行创建应用程序后returns这个错误:

[CRITICAL] [Window] Unable to find any valuable Window provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
sdl2 - Exception: SDL2: Unable to load image 
File "kivy\core\__init__.py", line 70, in core_select_lib
   File "kivy\core\window\window_sdl2.py", line 152, in __init__
   File "kivy\core\window\__init__.py", line 982, in __init__
   File "kivy\core\window\window_sdl2.py", line 311, in create_window
   File "kivy\core\window\__init__.py", line 1268, in create_window
   File "kivy\graphics\instructions.pyx", line 783, in kivy.graphics.instructions.RenderContext.__init__
   File "kivy\core\image\__init__.py", line 561, in __init__
   File "kivy\core\image\__init__.py", line 754, in _set_filename
   File "kivy\core\image\__init__.py", line 460, in load
   File "kivy\core\image\__init__.py", line 223, in __init__
   File "kivy\core\image\img_sdl2.py", line 47, in load

[CRITICAL] [App] Unable to get a Window, abort.

我可能可行的解决方案是我在 kivy issues 中找到的提示: Kivy issues

这把我带到了下面的 post 并翻译它要求卸载枕头并重新安装轮子

python3 -m pip3 uninstall pillow
python3 -m pip3 install --use-wheel pillow

但是没有。

我需要你的帮助。谁设法用 kivy

生成了 Windows 的应用程序

我正在使用Windows10来打包。

此错误很常见 - 以下是一些有用的链接:

https://github.com/kivy/kivy/issues/6342

https://github.com/pal1000/save-legacy-intel-graphics

Kivy does not detect OpenGL 2.0

Unable to get a window, abort

https://pyinstaller.readthedocs.io/en/stable/when-things-go-wrong.html

https://github.com/kivy/kivy/issues/6276

如果 none 这些工作,我还制作了一个关于将 kivy 应用程序打包到 Windows 的单个 exe 的视频:https://www.youtube.com/watch?v=k9Hx0q5Sopg

如果成功请告诉我。干杯!