Kivy错误:[CRITICAL] [App]无法获得一个窗口,中止
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Kivy错误:[CRITICAL] [App]无法获得一个窗口,中止相关的知识,希望对你有一定的参考价值。
所有针对此Kivy错误的解决方案对我来说都不起作用。现在已经有2个星期了,但我所有的努力都是徒劳的。我使用python 3.6.4,kivy 1.10.1,pycharm作为我的IDE和Windows 10.这里是错误代码和代码本身:
代码:
from kivy.core.window import Window
import os
os.environ['KIVY_GL_BACKEND'] = 'angel_sdl2'
from kivy.app import App
from kivy.uix.button import Button
# from kivy import Config
# Config.set('graphics', 'multisamples', '0')
class MyApp(App):
def build(self):
return Button(text='Hello world')
if __name__ == '__main__':
MyApp().run()
错误:
enter code here"C:\Program Files\Python36-32\python.exe"
"C:/Users/Sabinus O Ofoleta/Desktop/python/tested.py"
[INFO ] [Logger ] Record log in C:\Users\Sabinus O Ofoleta\.kivy\logs\kivy_19-02-21_4.txt
[INFO ] [Kivy ] v1.10.1
[INFO ] [Python ] v3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 12:45:02) [MSC v.1900 32 bit (Intel)]
[INFO ] [Factory ] 194 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
[INFO ] [Window ] Provider: sdl2
[INFO ] [Window ] Activate GLES2/ANGLE context
[CRITICAL] [Window ] Unable to find any valuable Window provider.
sdl2 - RuntimeError: b'Could not initialize EGL'
File "C:\Program Files\Python36-32\Lib\site-packages \kivy\core\__init__.py", line 67, in core_select_lib
cls = cls()
File "C:\Program Files\Python36-32\Lib\site-packages \kivy\core\window\window_sdl2.py", line 140, in __init__
super(WindowSDL, self).__init__()
File "C:\Program Files\Python36-32\Lib\site-packages\kivy\core\window\__init__.py", line 968, in __init__
self.create_window()
File "C:\Program Files\Python36-32\Lib\site-packages\kivy\core\window\window_sdl2.py", line 272, in create_window
self.fullscreen,resizable , state)
File "kivy\core\window\_window_sdl2.pyx", line 209, in kivy.core.window._window_sdl2._WindowSDL2Storage.setup_window
File "kivy\core\window\_window_sdl2.pyx", line 66, in kivy.core.window._window_sdl2._WindowSDL2Storage.die
[CRITICAL] [App ] Unable to get a Window, abort.
Process finished with exit code 1
我的电脑正在使用opengl 1.1,因为其他版本不兼容所以我决定使用'angel sdl2'。谢谢
我发现很难相信可以运行Windows 10的计算机无法运行更新版本的opengl而不是1.1,这已经超过20年了,OpenGL ES 2.0本身已经超过10年了。更有可能的是,您没有安装GPU的驱动程序。即使使用angle_sdl2,您也需要使用DirectX 11,因为角度只是OpenGL的一个实现。
以上是关于Kivy错误:[CRITICAL] [App]无法获得一个窗口,中止的主要内容,如果未能解决你的问题,请参考以下文章
Kivy错误:[CRITICAL] [App]无法获得一个窗口,中止
Kivy 错误,[CRITICAL] [Text] 无法找到任何有价值的文本提供程序(python 3.6.1)(windows 10)
from kivy.core.window._window_sdl2 import _WindowSDL2Storage [CRITICAL] [App] 无法获取窗口,中止 [重复]
让 Kivy 最终在 Eclipse 中工作,编译然后错误:CRITICAL Application No window is created.Terminating application run