Python KIVY :: ModuleNotFoundError:没有名为kivy.clock的模块

时间:2020-04-28 21:55:46

标签: python kivy

我刚刚安装了kivy,现在我一直在尝试使用它,但我一直收到此错误消息:

[INFO   ] [Logger      ] Record log in C:\Users\goal\.kivy\logs\kivy_20-04-28_9.txt
[INFO   ] [deps        ] Successfully imported "kivy_deps.gstreamer_dev" 0.2.0
[INFO   ] [deps        ] Successfully imported "kivy_deps.glew" 0.2.0
[INFO   ] [deps        ] Successfully imported "kivy_deps.glew_dev" 0.2.0
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "C:\Users\goal\AppData\Roaming\Python\Python37\site- 
packages\kivy\__init__.py"
[INFO   ] [Python      ] v3.7.6 (tags/v3.7.6:43364a7ae0, Dec 19 2019, 00:42:30) [MSC v.1916 64 bit 
(AMD64)]
[INFO   ] [Python      ] Interpreter at "C:\Program Files\Python37\python.exe"
[ERROR  ] [Clock       ] Unable to import kivy._clock. Have you perhaps forgotten to compile kivy? 
Kivy contains Cython code which needs to be compiled. A missing kivy._clock often indicates the 
Cython code has not been compiled. Please follow the installation instructions and make sure to 
compile Kivy
Traceback (most recent call last):
File "C:\Users\goal\3D Objects\My Projects\PythonApplication2\PythonApplication2.py", line 3, in 
<module>
 from kivy.app import App
File "C:\Users\goal\AppData\Roaming\Python\Python37\site-packages\kivy\app.py", line 319, in <module>
 from kivy.base import runTouchApp, stopTouchApp
File "C:\Users\goal\AppData\Roaming\Python\Python37\site-packages\kivy\base.py", line 26, in <module>
 from kivy.clock import Clock
File "C:\Users\goal\AppData\Roaming\Python\Python37\site-packages\kivy\clock.py", line 363, in 
<module>
 from kivy._clock import CyClockBase, ClockEvent, FreeClockEvent, \
ModuleNotFoundError: No module named 'kivy._clock'

这是我从其网站复制的代码,我尝试了几种不同的方法,但仍得到了相同的结果:

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

class myapp(App):

    def build(self):

        return Label(text="Hello World")

myapp().run()

0 个答案:

没有答案