1
When trying to run script
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
class TelaLogin(GridLayout):
def __init__(self, **kwargs):
super(TelaLogin, self).__init__(**kwargs)
self.cols = 2
self.add_widget(Label(text='Usuário'))
self.username = TextInput(multiline=False)
self.add_widget(self.username)
self.add_widget(Label(text='Senha'))
self.password = TextInput(password=True, multiline=False)
self.add_widget(self.password)
class MyApp(App):
def build(self):
return TelaLogin()
if __name__ == '__main__':
MyApp().run()
To execute the command placed > kivy main.py
I get the following error
kivy : O termo 'kivy' não é reconhecido como nome de cmdlet, função, arquivo de script ou programa operável. Verifique a grafia do nome ou, se um caminho tiver
sido incluído, veja se o caminho está correto e tente novamente.
No linha:1 caractere:1
+ kivy main.py
+ ~~~~
+ CategoryInfo : ObjectNotFound: (kivy:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
You are using Windows, right? Kivy has been installed in a virtualenv? Which version are you using? You followed the installation procedure from here? What about the Python version? It looks like it’s supported up to Python 3.7, see here
– Paulo Marques
I followed the procedures of kivy.org and managed to use it from the cmd, which is already a good thing. I had to install Python 3.6 because kivy only supports this down
– Paulo Henrique
Still in error?
– Paulo Marques
The error only happens when I try to run by Vscode, however I am getting it when I run by CMD
– Paulo Henrique
The interpreter in VS Code must be pointing to another version of Python.
– Paulo Marques