我正在尝试让kivy在我的Ubuntu系统上工作。我遵循了他们wesbite中的说明。
但是当我试图从他们的网站上运行下面的hello world代码时:
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()我得到以下错误:
[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是不是和我的显卡有关?我使用的是ATI Mobility Radeon HD 5400显卡。
发布于 2013-03-10 01:50:25
最终通过将Ubuntu更新到12.10来让它工作,似乎问题出在图形驱动程序上。现在,示例的运行情况与预期一致。谢谢琼杰和夸诺。
发布于 2013-03-08 04:55:32
我按照你提供的指示去做。使用你提供的代码,我得到了这个结果。如图所示

。python版本是python2.7。我使用的系统是ubuntu12.10。
代码需要超级用户权限,我从命令行运行代码: sudo python demo.py
尝试使用'sudo‘来运行它。
https://stackoverflow.com/questions/15281239
复制相似问题