kivy with error 'unable to get a window'

可紊 提交于 2020-01-16 05:00:25

问题


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()

it gives following error:

Unable to get a Window, abort.

I tried on python3.4, same error. Anyone know how to solve this problem? Please.


回答1:


There is an option that sdl2 can't find dlls needed to load *.png

  • Try to find libpng16-16.dll

on my PC is here: C:\Python27\share\gstreamer\bin

  • Add it to PATH

    set PATH=C:\Python27\share\gstreamer\bin;%PATH%

This is temporary solution but it works for me



来源:https://stackoverflow.com/questions/34640466/kivy-with-error-unable-to-get-a-window

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!