When I run my Kivy application it terminates early. I followed the installation instructions on Kivy's website.
main.py
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.lang import Builder
import os
os.environ['KIVY_WINDOW'] = 'sdl2'
os.environ['KIVY_GL_BACKEND'] = 'angle_sdl2'
Builder.load_file('main.kv')
class MyLayout(Widget):
pass
class TheMonitorApp(App):
def build(self):
return MyLayout()
if __name__ == '__main__':
TheMonitorApp().run
main.kv
#:kivy 2.0.0
<MyLayout>
BoxLayout:
orientation: "vertical"
size: root.width, root.height
Label:
text: "Monitor"
font_size: 32
Terminal
(kivy_venv) pi@raspberrypi:~/projects/HomeMonitor $ python main.py
[INFO ] [Logger ] Record log in /home/pi/.kivy/logs/kivy_21-11-03_19.txt
[INFO ] [Kivy ] v2.0.0
[INFO ] [Kivy ] Installed at "/home/pi/projects/HomeMonitor/kivy_venv/lib/python3.7/site-packages/kivy/__init__.py"
[INFO ] [Python ] v3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0]
[INFO ] [Python ] Interpreter at "/home/pi/projects/HomeMonitor/kivy_venv/bin/python"
[INFO ] [Factory ] 186 symbols loaded
[INFO ] [ImageLoaderFFPy] Using ffpyplayer 4.3.2
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_ffpyplayer
(kivy_venv) pi@raspberrypi:~/projects/HomeMonitor $
Notice the terminal output stops at "[INFO ] [Image ]", why does it stop here? It still needs to reach "Window" and "GL".
Also if I delete these lines nothing changes:
import os
os.environ['KIVY_WINDOW'] = 'sdl2'
os.environ['KIVY_GL_BACKEND'] = 'angle_sdl2'