Hello world not working. Python 3.4, Kivy 1.9.1

145 views
Skip to first unread message

Gerschel Payne

unread,
Apr 9, 2016, 3:29:00 AM4/9/16
to Kivy users support
Here are the logs.  

[INFO              ] Logger: Record log in C:\Users\Autumn\.kivy\logs\kivy_16-04-09_6.txt
[INFO              ] Kivy: v1.9.1
[INFO              ] Python: v3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)]
[INFO              ] Factory: 179 symbols loaded
[INFO              ] Image: Providers: img_tex, img_dds, img_gif, img_sdl2 (img_pil, img_ffpyplayer ignored)
[INFO              ] Text: Provider: sdl2
[WARNING           ] stderr: Traceback (most recent call last):
[WARNING           ] stderr:   File "C:/Users/Autumn/PycharmProjects/untitled/kivy_play.py", line 8, in <module>
[WARNING           ] stderr:     class MyApp(app):
[WARNING           ] stderr: TypeError: module.__init__() takes at most 2 arguments (3 given)

Here is the program:  

import kivy
from kivy import app
kivy.require("1.9.1")

from kivy.uix.label import Label


class MyApp(app):

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


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

Gerschel Payne

unread,
Apr 9, 2016, 4:44:49 AM4/9/16
to Kivy users support
I GOT IT!  


Documentation needs help. So I was in the file python34/Lib/site-packages/kivy/app and saw it mention something about find examples in a folder that actually doesn't exist. But we write a subclass of App.run(). So I tried to replace it in Pycharm. No go. But when I tried to write app.run(), I had a pop up that gave class options, and one of them was App, so I tried
app.App
as the inheritance, and it worked.

Alexander Taylor

unread,
Apr 9, 2016, 6:44:47 AM4/9/16
to Kivy users support
What documentation did you follow that told you to inherit from kivy.app, rather than kivy.app.App?

安东

unread,
Apr 11, 2016, 7:32:50 AM4/11/16
to Kivy users support
You should inherit from kivy.app.App instead of kivy.app, because App is a class and app is a module.


在 2016年4月9日星期六 UTC+8下午4:44:49,Gerschel Payne写道:
Reply all
Reply to author
Forward
0 new messages