5

I am trying to make kivy work on my Ubuntu system. I followed the instructions from their wesbite.

But when I try to run the following hello world code from their website:

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()

I get following error :

[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

Has it something to do with my graphics card? I am using ATI Mobility Radeon HD 5400 graphics card.

akash
  • 237
  • 4
  • 18
  • 1
    could you try updating to the latest driver for your GPU, If you aren't using it already. – qua-non Mar 08 '13 at 08:23
  • I am using ubuntu 12.04 LTS and am unable to get the GPU(ATI 5400 series) driver working. Can this be the cause of the problem? – akash Mar 09 '13 at 11:58
  • Yes, Kivy needs a driver that supports at-least OpenGL ES 2.0. – qua-non Mar 09 '13 at 14:04

2 Answers2

5

Finally got it working by updating Ubuntu to 12.10 Seems like the issue was the graphics driver. Now the example is working as expected. Thanks Qiongjie and qua-non.

akash
  • 237
  • 4
  • 18
3

I follow the instruction you provided. and using the codes you provide, i have this result. See the figure figure1. The python version is python2.7. System I use is ubuntu12.10.

The code needs super user privilege, and I ran the code from command line: sudo python demo.py

try to use 'sudo' to run it.

tqjustc
  • 3,624
  • 6
  • 27
  • 42
  • Hi Qiongjie, welcome to [SO]! You need at least 10 rep to post images, so if the figure is important, you should post it to imgur or something and link to it in your answer. – askewchan Mar 07 '13 at 20:57
  • Now you should have sufficient reputation anyway :) – askewchan Mar 07 '13 at 21:02
  • 1
    Thanks for the quick response Qiongjie. But this doesn't solve my problem. I have already tried running it using sudo. Doesn't work. – akash Mar 08 '13 at 05:18
  • @akash which python version do you use ? – tqjustc Mar 08 '13 at 08:17
  • 4
    @QiongjieTian, There is nothing in the app that warrants running it with root privileges. Please be aware of how big a risk this is(running your app/s as root). Kivy on startup tries to access multi-touch devices by probing sysfs and throws a warning/error if it can't access the device. The solution for such a situation is to give permission to your user to access the device if you have one or safely ignore the warning if you don't want to give kivy access to it or disable probesysfs in config. Running your app as root is not recommended. – qua-non Mar 08 '13 at 14:56
  • sorry, but i added -1 for recommending sudo, it's not and shouldn't be needed. – Tshirtman Mar 15 '15 at 11:58