I'm building a game using Kivy. I'm encountering performance issues so I decided to profile the program.
I tried to run it by:
python -m cProfile main.py
The application screen stays black. After several seconds, an exception crashes the program:
Traceback (most recent call last):File "c:\python27\Lib\runpy.py", line 162, in _run_module_as_main"__main__", fname, loader, pkg_name)File "c:\python27\Lib\runpy.py", line 72, in _run_codeexec code in run_globalsFile "c:\python27\Lib\cProfile.py", line 199, in <module>main()File "c:\python27\Lib\cProfile.py", line 192, in mainrunctx(code, globs, None, options.outfile, options.sort)File "c:\python27\Lib\cProfile.py", line 49, in runctxprof = prof.runctx(statement, globals, locals)File "c:\python27\Lib\cProfile.py", line 140, in runctxexec cmd in globals, localsFile "main.py", line 26, in <module>GameApp().run()File "C:\Users\Aviv\Envs\game\lib\site-packages\kivy\app.py", line 828, in runrunTouchApp()File "C:\Users\Aviv\Envs\game\lib\site-packages\kivy\base.py", line 487, in runTouchAppEventLoop.window.mainloop()File "C:\Users\Aviv\Envs\game\lib\site-packages\kivy\core\window\window_sdl2.py", line 619, in mainloopself._mainloop()File "C:\Users\Aviv\Envs\game\lib\site-packages\kivy\core\window\window_sdl2.py", line 403, in _mainloopx, y = self._fix_mouse_pos(x, y)File "C:\Users\Aviv\Envs\game\lib\site-packages\kivy\core\window\window_sdl2.py", line 358, in _fix_mouse_posself.mouse_pos = x, self.system_size[1] - yFile "kivy\properties.pyx", line 408, in kivy.properties.Property.__set__ (kivy\properties.c:5114)File "kivy\properties.pyx", line 446, in kivy.properties.Property.set (kivy\properties.c:5876)File "kivy\properties.pyx", line 501, in kivy.properties.Property.dispatch (kivy\properties.c:6557)File "kivy\_event.pyx", line 1224, in kivy._event.EventObservers.dispatch (kivy\_event.c:13497)File "kivy\_event.pyx", line 1130, in kivy._event.EventObservers._dispatch (kivy\_event.c:12696)File "game\opening_screen.py", line 22, in _on_mouse_posif self.ids.start_button.collide_point(*position):File "kivy\properties.pyx", line 757, in kivy.properties.ObservableDict.__getattr__ (kivy\properties.c:11882)AttributeError: 'super' object has no attribute '__getattr__'
Why is this happening, and how can I profile my Kivy application?