ImportError: cannot import name app

1,150 views
Skip to first unread message

Ali Tavallaie

unread,
Aug 30, 2015, 3:45:17 PM8/30/15
to Kivy users support
I install kivy from stable repository and Pygame and Cyton is upgrade. when I run this code :
import kivy
kivy
.require('1.9.0')
from kivy.app import app
from kivy.uix.label import Label


class MyApp(App):

   
def build(self):
       
return Label(text='Hello world')


if __name__ == '__main__':
   
MyApp().run()


I give this error :

[INFO   ] [Kivy        ] v1.9.0
[INFO   ] [Python      ] v2.7.9 (default, Apr  2 2015, 15:33:21)
[GCC 4.9.2]
[INFO   ] [Factory     ] 173 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored)
 
Traceback (most recent call last):
   
File "learn 1.py", line 3, in <module>
     
from kivy.app import app
 
ImportError: cannot import name app


anyone has idea how to solve it ?

Alexander Taylor

unread,
Aug 30, 2015, 5:57:42 PM8/30/15
to Kivy users support
You need to import App, not app (note the case).
Reply all
Reply to author
Forward
0 new messages