pythonpython-3.xubuntukivykivy-language

the .kv file is not being attached on Ubuntu


I just started using Python Kivy I have this two files

# main.py
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout

class Container(BoxLayout):
    pass

class MyApp(App):
    def build(self):
        return Container()

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

and

# My.kv

<Container>:
    orientation: 'vertical'
    padding: 50
    spacing: 25

    Button:
        size: 100, 100
        size_hint: None, None
        text: 'Hello'

    Button:
        text: 'World'

everything works on Windows, but I need Linux to build it.

if I run the same files on Ubuntu 18.04, I will get a black screen. When working without .kv there is no such problem, all widgets are displayed.

What's the matter?


Solution

  • Your My.kv should be named my.kv. Since Windows doesn't care about upper/lower case in file names, it works there.