Ganesh
Ganesh

Reputation: 50

I am getteing an error in kivy python

i am developing android app with python and kivy i am using boxlayout and trying to load layout with string but it not loading and giving me this error and opening an black window when i am run this code i am not understanding what is the problem now i am getting this error please help to solve this problem

from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
from kivy.uix.label import Label



Builder.load_string('''
<Layout>:
    Lebel:
        text: "Hello World"
''')


class Layout(BoxLayout):
        pass

class MyApp(App):
    def build(self):
        return Layout()

MyApp().run()

and this is error

    Traceback (most recent call last):
   File "/root/Desktop/MyApp/main.py", line 25, in <module>
     MyApp().run()
   File "/usr/lib/python2.7/dist-packages/kivy/app.py", line 802, in run
     root = self.build()
   File "/root/Desktop/MyApp/main.py", line 23, in build
     return Layout()
   File "/usr/lib/python2.7/dist-packages/kivy/uix/boxlayout.py", line 102, in __init__
     super(BoxLayout, self).__init__(**kwargs)
   File "/usr/lib/python2.7/dist-packages/kivy/uix/layout.py", line 72, in __init__
     super(Layout, self).__init__(**kwargs)
   File "/usr/lib/python2.7/dist-packages/kivy/uix/widget.py", line 320, in __init__
     Builder.apply(self, ignored_consts=self._kwargs_applied_init)
   File "/usr/lib/python2.7/dist-packages/kivy/lang.py", line 1970, in apply
     self._apply_rule(widget, rule, rule, ignored_consts=ignored_consts)
   File "/usr/lib/python2.7/dist-packages/kivy/lang.py", line 2044, in _apply_rule
     cls = Factory_get(cname)
   File "/usr/lib/python2.7/dist-packages/kivy/factory.py", line 131, in __getattr__
     raise FactoryException('Unknown class <%s>' % name)
 kivy.factory.FactoryException: Unknown class <Lebel>
[Finished in 0.6s with exit code 1]
[shell_cmd: python -u "/root/Desktop/MyApp/main.py"]
[dir: /root/Desktop/MyApp]
[path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin]

Upvotes: 0

Views: 158

Answers (1)

inclement
inclement

Reputation: 29460

kivy.factory.FactoryException: Unknown class

You misspelled Label.

Upvotes: 2

Related Questions