Debesh Mohanty
Debesh Mohanty

Reputation: 489

Kivy programming error

I am new to kivy...

I got some errors in just a hello world program and I am not able to understand it.

Please help me out

The code is

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

The error message is

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

I am using ubuntu 14.10

Upvotes: 0

Views: 949

Answers (2)

leGenti
leGenti

Reputation: 1

Have you imported kivy to begin with?

import kivy
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout

Upvotes: 0

mjy
mjy

Reputation: 324

Your first error is "Ignored (import error)".
You need to install the "python3-pygame".
However, the official repository of Ubuntu does not have "python3-pygame".
For example, please install to do this.

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

Upvotes: 1

Related Questions