2013-03-07 7 views
5

Sto cercando di far funzionare Kivy sul mio sistema Ubuntu. Ho seguito le istruzioni dal loro wesbite.Kivy ciao mondo non funziona

Ma quando provo a fare funzionare il seguente codice di ciao mondo dal loro sito:

import kivy 
kivy.require('1.5.1') # replace with your current kivy version ! 

from kivy.app import App 
from kivy.uix.button import Button 

class MyApp(App): 
    def build(self): 
     return Button(text='Hello World') 

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

ottengo l'errore seguente:

[INFO ] Kivy v1.5.1 
[INFO ] [Logger  ] Record log in /home/malik/.kivy/logs/kivy_13-03-08_6.txt 
[INFO ] [Factory  ] 137 symbols loaded 
[DEBUG ] [Cache  ] register <kv.lang> with limit=None, timeout=Nones 
[DEBUG ] [Cache  ] register <kv.image> with limit=None, timeout=60s 
[DEBUG ] [Cache  ] register <kv.atlas> with limit=None, timeout=Nones 
[DEBUG ] [Cache  ] register <kv.texture> with limit=1000, timeout=60s 
[DEBUG ] [Cache  ] register <kv.shader> with limit=1000, timeout=3600s 
[INFO ] [Text  ] using <pygame> as text provider 
[DEBUG ] [App   ] Loading kv <./my.kv> 
[DEBUG ] [App   ] kv <./my.kv> not found 
[INFO ] [Window  ] using <pygame> as window provider 
    X Error of failed request: BadRequest (invalid request code or no such operation) 
    Major opcode of failed request: 138 (ATIFGLEXTENSION) 
    Minor opcode of failed request: 66() 
    Serial number of failed request: 14 
    Current serial number in output stream: 14 

ha qualcosa a che fare con la mia scheda grafica? Uso la scheda grafica ATI Mobility Radeon HD 5400.

+1

potresti provare ad aggiornare il driver più recente per la tua GPU, se non lo stai già utilizzando. –

+0

Sto usando Ubuntu 12.04 LTS e non riesco a far funzionare il driver GPU (ATI serie 5400). Può essere questa la causa del problema? – akash

+0

Sì, Kivy ha bisogno di un driver che supporti almeno OpenGL ES 2.0. –

risposta

5

Finalmente ha funzionato aggiornando Ubuntu a 12.10 Sembra che il problema fosse il driver grafico. Ora l'esempio funziona come previsto. Grazie Qiongjie e qua-non.

3

Seguo le istruzioni fornite. e usando i codici che fornisci, ho questo risultato. Vedi la figura figure1. La versione python è python2.7. Il sistema che uso è ubuntu12.10.

Il codice ha bisogno di privilegi di super utente, e ho eseguito il codice da linea di comando: sudo python demo.py

provare ad usare 'sudo' per eseguirlo.

+0

Ciao Qiongjie, benvenuto in [SO]! Hai bisogno di almeno 10 rappresentanti per pubblicare immagini, quindi se la figura è importante, devi postarla su imgur o qualcosa del genere e collegarla ad essa nella tua risposta. – askewchan

+0

@askewchan capito. Grazie – tqjustc

+0

Ora dovresti avere una reputazione sufficiente in ogni caso :) – askewchan