0
我是基維新手...Kivy編程錯誤
我在一個hello世界程序中遇到了一些錯誤,我無法理解它。
請幫我
的代碼是
from kivy.app import App
from kivy.uix.label import Label
class test(App):
def build(self):
return Label(text="hello world")
if __name__=="__main__":
test().run()
的錯誤消息是
[INFO ] Kivy v1.8.0
[INFO ] [Logger ] Record log in /home/debesh/.kivy /logs/kivy_15-05-01_1.txt
[INFO ] [Factory ] 157 symbols loaded
[DEBUG ] [Cache ] register <kv.lang> with limit=None, timeout=Nones
[DEBUG ] [Cache ] register <kv.image> with limit=None, timeout=60s
[DEBUG ] [Cache ] register <kv.atlas> with limit=None, timeout=Nones
[INFO ] [Image ] Providers: img_tex, img_dds, img_pil, img_gif (img_pygame ignored)
[DEBUG ] [Cache ] register <kv.texture> with limit=1000, timeout=60s
[DEBUG ] [Cache ] register <kv.shader> with limit=1000, timeout=3600s
[DEBUG ] [Text ] Ignored <pygame> (import error)
[DEBUG ] [Text ] Ignored <sdlttf> (import error)
[INFO ] [Text ] Provider: pil(['text_pygame', 'text_sdlttf'] ignored)
[DEBUG ] [App ] Loading kv <./test.kv>
[DEBUG ] [App ] kv <./test.kv> not found
[DEBUG ] [Window ] Ignored <egl_rpi> (import error)
[DEBUG ] [Window ] Ignored <pygame> (import error)
[WARNING] [WinPygame ] SDL wrapper failed to import!
[DEBUG ] [Window ] Ignored <sdl> (import error)
[DEBUG ] [Window ] Ignored <x11> (import error)
[CRITICAL] [Window ] Unable to find any valuable Window provider at all!
[CRITICAL] [App ] Unable to get a Window, abort.
Exception ignored in: 'kivy.properties.dpi2px'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/kivy/utils.py", line 356, in __get__
retval = self.func(inst)
File "/usr/lib/python3/dist-packages/kivy/metrics.py", line 169, in dpi
EventLoop.ensure_window()
File "/usr/lib/python3/dist-packages/kivy/base.py", line 125, in ensure_window
sys.exit(1)
SystemExit: 1
[CRITICAL] [App ] Unable to get a Window, abort.
我使用Ubuntu 14.10
你可以嘗試像'出口顯示器=:0'在你的bash shell(我想完蛋了...)它可能工作 –
做任何kivy應用程序的工作?也許你的安裝被破壞了。 – inclement
也許嘗試獲取最新的包,1.9.0,而不是舊的1.8? – Tshirtman