奇异果,错误提示“无法打开窗口" [英] kivy with error 'unable to get a window'
本文介绍了奇异果,错误提示“无法打开窗口"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都知道如何使用kivy吗?我在python2.7的window7上安装了它.当我运行以下代码时:
Anyone know how to use kivy? I installed it on my window7, python2.7. When I run following code:
import kivy
from kivy.app import App
from kivy.uix.label import Label
class MyApp(App):
def build(self):
return Label(text='Hello World!')
if __name__ == '__main__':
MyApp().run()
它给出以下错误:
无法获取窗口,请中止.
Unable to get a Window, abort.
我在python3.4上尝试过,出现同样的错误.有人知道如何解决这个问题吗?拜托.
I tried on python3.4, same error. Anyone know how to solve this problem? Please.
推荐答案
有一个选项,sdl2找不到加载* .png所需的dll
There is an option that sdl2 can't find dlls needed to load *.png
- 尝试找到
libpng16-16.dll
在这里:C:\Python27\share\gstreamer\bin
-
将其添加到PATH
Add it to PATH
set PATH=C:\Python27\share\gstreamer\bin;%PATH%
这是临时解决方案,但对我有用
This is temporary solution but it works for me
这篇关于奇异果,错误提示“无法打开窗口"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文