简单的Kivy应用程序崩溃(释放解锁锁)

时间:2017-03-03 22:25:14

标签: kivy

尝试运行最简单的Kivy应用程序时出现以下错误:

C:\Users\kprice\Desktop>python test.py
[INFO   ] [Logger      ] Record log in C:\Users\kprice\AppData\Roaming\SPB_16.6\.kivy\logs\kivy_17-03-03_57.txt
[INFO   ] [Kivy        ] v1.9.2.dev0, git-9f2daa0, 20170302
[INFO   ] [Python      ] v3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)]
[INFO   ] [Factory     ] 193 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [OSC         ] using <thread> for socket
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] GLEW initialization succeeded
[INFO   ] [GL          ] Backend used <glew>
[INFO   ] [GL          ] OpenGL version <b'4.3.0 - Build 10.18.15.4256'>
[INFO   ] [GL          ] OpenGL vendor <b'Intel'>
[INFO   ] [GL          ] OpenGL renderer <b'Intel(R) HD Graphics 4400'>
[INFO   ] [GL          ] OpenGL parsed version: 4, 3
[INFO   ] [GL          ] Shading version <b'4.30 - Build 10.18.15.4256'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <32>
[INFO   ] [Shader      ] fragment shader: <b"WARNING: 0:6: '' :  #version directive missing">
[INFO   ] [Shader      ] vertex shader: <b"WARNING: 0:6: '' :  #version directive missing">
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
 Traceback (most recent call last):
   File "test.py", line 13, in <module>
     MyApp().run()
   File "C:\Users\kprice\AppData\Local\Programs\Python\Python36\lib\site-packages\kivy\app.py", line 802, in run
     root = self.build()
   File "test.py", line 10, in build
     return Label(text='Hello world')
   File "C:\Users\kprice\AppData\Local\Programs\Python\Python36\lib\site-packages\kivy\uix\label.py", line 291, in __init__
     self._trigger_texture()
   File "kivy\_clock.pyx", line 75, in kivy._clock.ClockEvent.__call__ (kivy\_clock.c:2223)
 RuntimeError: release unlocked lock

该应用程序的代码如下:

from kivy.app import App
from kivy.uix.label import Label

class MyApp(App):

    def build(self):
        return Label(text='Hello world')

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

关于为什么即使最基本的程序似乎崩溃的任何想法?

1 个答案:

答案 0 :(得分:0)

这是kivy.clock代码更改的typo。它基本上称为方法两次,它不应该(没有线程锁定释放)。

我不确定是因为Cython还是因为Windows,但我认为错误应该返回ThreadError。 Kivy中RuntimeError的数量太少,所以我不确定为什么它会返回错误类型的错误。