如何修复“没有名为"kivy._clock"的模块" ubuntu中的错误? [英] How to fix "No module named 'kivy._clock'" error in ubuntu?
问题描述
我正在尝试使用适用于Python 3.6的Ubuntu 16.04安装"kivy"(GUI库)
I'm trying to install "kivy" (GUI lib) with Ubuntu 16.04 for Python 3.6
我尝试在kivy官方网站( https://kivy.org/doc/stable/installation/installation-linux.html )
I tried doing the steps in the kivy official website (https://kivy.org/doc/stable/installation/installation-linux.html)
我在终端机上输入了
sudo add-apt-repository ppa:kivy-team/kivy
sudo apt-get update
sudo apt-get install python3-kivy
当我尝试导入时:
from kivy.app import App
我得到了错误:
ModuleNotFoundError: No module name 'kivy._clock'
推荐答案
在终端中尝试以下操作:
Try this in terminal:
- 确保已为python3安装了pip
$ sudo apt-get install python3-pip
- 卸载python3-kivy
$ sudo apt-get purge python3-kivy
- 找出您的python3版本;请注意前两位数字:
$ python3 -V
输出:
Python 3.7.3
Python 3.7.3
-
在此处查找最新的构建每晚构建/更新链接: https://kivy.org/downloads/ci/linux/kivy/
复制文件名称中具有
cpXX
值的最新版本的链接,该值与python3版本的前两位数字匹配.对我来说,这是cp37
.Copy the link of the latest build that has a
cpXX
value in the file name that matches the first two digits of your python3 version. For me, this iscp37
.最后,将链接放入下一个命令的相关部分:
Finally, put the link in the relevant section of the next command:
$ python3 -m pip install [linkherewithoutbrackets] --user
这对我来说修复了相同的错误:Debian 10,python3 v3.7.3.最终安装了kivy v2.0.0rc1.
This fixed the same error for me with: Debian 10, python3 v3.7.3. This ultimately installed kivy v2.0.0rc1.
资源将来应该会发生变化:
Resources should links change in the future:
-
用于确定兼容的cython版本: https://kivy. org/doc/stable/installation/deps-cython.html
有关linux的安装说明(以及我在哪里找到了每晚的车轮构建链接): https://kivy.org/doc/stable/installation/installation-linux.html
For the linux install instructions (and where I found the nightly wheels build link): https://kivy.org/doc/stable/installation/installation-linux.html
这篇关于如何修复“没有名为"kivy._clock"的模块" ubuntu中的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
-