在pyinstaller生成的exe上找不到任何有价值的Window提供程序

时间:2018-11-23 03:00:32

标签: python kivy pyinstaller

我用奇异果编写了一个程序。

使用来执行该工具效果很好,但是在我尝试之后:

pyinstaller --onefile <Mycode.py> 

并生成了我的exe文件,Kivy无法运行

记录如下:

[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] GLEW initialization succeeded
[INFO   ] [GL          ] Backend used <glew>
[INFO   ] [GL          ] OpenGL version <b'4.4.0 - Build 21.20.16.4565'>
[INFO   ] [GL          ] OpenGL vendor <b'Intel'>
[INFO   ] [GL          ] OpenGL renderer <b'Intel(R) HD Graphics 530'>
[INFO   ] [GL          ] OpenGL parsed version: 4, 4
[INFO   ] [GL          ] Shading version <b'4.40 - Build 21.20.16.4565'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <32>
[WARNING] [Image       ] Unable to load image <C:\Users\BILLY_~1\AppData\Local\T
emp\_MEI131842\kivy_install\data\glsl\default.png>
[CRITICAL] [Window      ] Unable to find any valuable Window provider.
sdl2 - Exception: SDL2: Unable to load image
  File "site-packages\kivy\core\__init__.py", line 67, in core_select_lib
  File "site-packages\kivy\core\window\window_sdl2.py", line 140, in __init__
  File "site-packages\kivy\core\window\__init__.py", line 968, in __init__
  File "site-packages\kivy\core\window\window_sdl2.py", line 294, in create_wind
ow
  File "site-packages\kivy\core\window\__init__.py", line 1216, in create_window

  File "kivy\graphics\instructions.pyx", line 759, in kivy.graphics.instructions
.RenderContext.__init__
  File "site-packages\kivy\core\image\__init__.py", line 536, in __init__
  File "site-packages\kivy\core\image\__init__.py", line 732, in _set_filename
  File "site-packages\kivy\core\image\__init__.py", line 435, in load
  File "site-packages\kivy\core\image\__init__.py", line 201, in __init__
  File "site-packages\kivy\core\image\img_sdl2.py", line 41, in load

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

1 个答案:

答案 0 :(得分:0)

原因是dll搜索路径中还有另一个zlib1.dll,可能该dll文件不包含kivy所需的功能。

您可以在dll搜索路径中简单地重命名或删除zlib1.dll文件,以我为例,该文件为c:\windows\system32\zlib1.dll,然后重新启动计算机,kivy应用程序成功启动。