Why is kivy unable to import kivy_clock?(为什么kivy无法导入kivy_clock?)
本文介绍了为什么kivy无法导入kivy_clock?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
https://kivy.org/doc/stable/api-kivy.app.html
import kivy
kivy.require('1.0.7')
from kivy.app import App
from kivy.uix.button import Button
class TestApp(App):
def build(self):
# return a Button() as a root widget
return Button(text='hello world')
if __name__ == '__main__':
TestApp().run()
根据上面的代码我有以下错误
[INFO ] [Logger ] Record log in C:UsersUSER.kivylogskivy_20-05-09_45.txt
[INFO ] [deps ] Successfully imported "kivy_deps.angle" 0.1.10
[INFO ] [Kivy ] v1.11.1
[INFO ] [Kivy ] Installed at "C:UsersUSERAppDataLocalProgramsPythonPython38-32libsite-packageskivy\__init__.py"
[INFO ] [Python ] v3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)]
[INFO ] [Python ] Interpreter at "C:UsersUSERAppDataLocalProgramsPythonPython38-32python.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/USER/PycharmProjects/Hello world/pop.py", line 4, in <module>
from kivy.app import App
File "C:UsersUSERAppDataLocalProgramsPythonPython38-32libsite-packageskivyapp.py", line 319, in <module>
from kivy.base import runTouchApp, stopTouchApp
File "C:UsersUSERAppDataLocalProgramsPythonPython38-32libsite-packageskivyase.py", line 26, in <module>
from kivy.clock import Clock
File "C:UsersUSERAppDataLocalProgramsPythonPython38-32libsite-packageskivyclock.py", line 363, in <module>
from kivy._clock import CyClockBase, ClockEvent, FreeClockEvent,
ModuleNotFoundError: No module named 'kivy._clock'
我认为 kivy_clock 和 Cython 有问题.
I think there is a problem with the kivy_clock and Cython.
推荐答案
因为你安装了 Kivy,你并没有编译它,也没有安装预编译版本.
Because however you installed Kivy, you didn't compile it or install a precompiled version.
您是否按照 kivy.org 的说明进行操作?
Did you follow the instructions as kivy.org?
这篇关于为什么kivy无法导入kivy_clock?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
沃梦达教程
本文标题为:为什么kivy无法导入kivy_clock?
基础教程推荐
猜你喜欢
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01