title: I am trying to add label in kivy using python file. But it is throwing an error everytime
body: <p>I want a label to be added when I press a button. So I created a function in .py file. But if I press the button it shows &quot;AttributeError: 'LabelSDL2' object has no attribute 'bind' &quot;.</p>
  <p>I want the label in the python file. Because I will remove it later.</p>
  <p>What should I do?</p>
  <p>Python File:</p>
  <pre><code>from kivy.app import App
  from kivy.core.text import Label
  from kivy.uix.relativelayout import RelativeLayout
  
  
  class MainWidget(RelativeLayout):
  
      def add_label(self):
          label = Label(text=&quot;Label Added&quot;, pos=(100, 100), size_hint=(.1, .1))
  
          self.add_widget(label)
  
  
  class LabelApp(App):
      pass
  
  
  LabelApp().run()
  
  </code></pre>
  <p>kv file:</p>
  <pre><code>MainWidget:
  
  &lt;MainWidget&gt;:
  
      Button:
          text: &quot;Add Label&quot;
          size_hint: .1, .1
          on_press: root.add_label()
  </code></pre>