2015-04-30 1 views
0

Je suis nouveau à kivy ...Kivy erreur de programmation

J'ai eu quelques erreurs dans juste un programme Bonjour tout le monde et je ne suis pas capable de le comprendre.

S'il vous plaît, aidez-moi

Le code est

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

Le message d'erreur est

[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. 

J'utilise ubuntu 14.10

+0

vous pouvez essayer quelque chose comme 'export DISPLAY =: 0' dans votre shell bash (je pense thats it ...) il pourrait fonctionner –

+0

Est-ce une des applications Kivy travail? Peut-être que votre installation est cassée. – inclement

+0

Peut-être essayer d'obtenir le dernier paquet, 1.9.0, au lieu de l'ancien 1.8? – Tshirtman

Répondre

1

Votre première erreur est « Ignoré (import Erreur)".
Vous devez installer le "python3-pygame".
Cependant, le référentiel officiel d'Ubuntu n'a pas "python3-pygame".
Par exemple, veuillez l'installer pour ce faire.

sudo add-apt-repository ppa:thopiekar/pygame 
sudo aptitude update 
sudo aptitude install python3-pygame