Python Forum
[Kivy] NameError: name 'App' is not defined
Thread Rating:
  • 2 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Kivy] NameError: name 'App' is not defined
#5
(Apr-02-2017, 04:13 PM)nengkya Wrote: Ty all for your response. I mean, how do i change my syntaxist if i only use import kivy ? [Image: erjwgd]
After looking at their code, it doesnt look like you will be able to do import kivy and do 

class MyApp(kivy.app.App):
   def build(self):
       return kivy.uix.label.Label(text='Hello world')
the closest you would come is this
import kivy.app
import kivy.uix.label
 
class MyApp(kivy.app.App):
   def build(self):
       return kivy.uix.label.Label(text='Hello world')
whihc you might as well just do
from kivy.app import App
from kivy.uix.label import Label
Recommended Tutorials:
Reply


Messages In This Thread
NameError: name 'App' is not defined - by nengkya - Mar-26-2017, 10:19 AM
RE: NameError: name 'App' is not defined - by metulburr - Apr-02-2017, 07:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  NameError: name 'self' is not defined hobbyist 30 14,702 Jul-25-2021, 10:22 AM
Last Post: hobbyist
  [WxPython] NameError: global name 'PyAssertionError' is not defined merlem 5 6,318 Jan-28-2017, 01:59 PM
Last Post: merlem

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020