Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kivy error with text input

Tags:

python

kivy

I'm trying to run this code in my pc, i tried every ways to do it but always I get the same error, I don't know what to do...

import kivy
kivy.require('1.0.7') 
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.codeinput import CodeInput
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from kivy.core.window import Window
from kivy.uix.accordion import Accordion, AccordionItem

Window.clearcolor = (1, 1, 1, 1)


class Myapp(App):

    def build(self):

        self.layout = BoxLayout(padding=50,orientation="vertical",spacing=30)
        Labe_Prin = Label(text="Bienvenido al login",font_name="data/fonts/Union_soap.ttf",color=(0,0,0,0.5),font_size=50)
        Label1 = Label(text="Ingrese Usuario: ",color=(0,0,0,1),font_size=(50*0.75),bold=True,italic=False,font_name="data/fonts/English_.ttf")
        Entrada1 = TextInput(multiline = False,size_hint=(1,.3),bold=True,font_size=12.3,foreground_color=(.5,.1,.3,1),text="Usuraio",use_bubble=True) #focus=True,use_handles=True
        Label2 = Label(text="Ingrese Contrasenia: ",color=(0,0,0,1),font_size=(50*0.75),bold=True,italic=False,font_name="data/fonts/English_.ttf")
        Entrada2 = CodeInput(multiline = False,size_hint=(1,.3),italic=True,font_size=12.3,foreground_color=(.5,.1,.3,1),text="Contrasenia",use_buble=True) #Contrasenia

        def press(self):
            print Entrada1.text
            print Entrada2.text

        Boton1 = Button(size_hint=(1, .4), text='Login',on_release=press)


        self.layout.add_widget(Labe_Prin)
        self.layout.add_widget(Label1)
        self.layout.add_widget(Entrada1)
        self.layout.add_widget(Label2)
        self.layout.add_widget(Entrada2)
        self.layout.add_widget(Boton1)

        return self.layout

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

and i have this error...

[CRITICAL          ] [Cutbuffer   ] Unable to find any valuable Cutbuffer provider at all!
xclip - OSError: [Errno 2] No existe el archivo o el directorio
  File "/usr/lib/python2.7/dist-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
  File "/usr/lib/python2.7/dist-packages/kivy/core/clipboard/clipboard_xclip.py", line 17, in <module>
p = subprocess.Popen(['xclip', '-version'], stdout=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception

xsel - OSError: [Errno 2] No existe el archivo o el directorio
   File "/usr/lib/python2.7/dist-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
  File "/usr/lib/python2.7/dist-packages/kivy/core/clipboard/clipboard_xsel.py", line 15, in <module>
p = subprocess.Popen(['xsel'], stdout=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception

I can execute the code, but i can't build to android

like image 652
German Alzate Avatar asked Nov 05 '15 01:11

German Alzate


2 Answers

I got same error, but installing xclip & xsel fixed this for me.

like image 192
Jari Salmela Avatar answered Oct 11 '22 15:10

Jari Salmela


sudo apt-get install xclip xsel
like image 24
Slaan Avatar answered Oct 11 '22 15:10

Slaan