How to fix quot;No module named #39;kivy._clock#39;quot; error in ubuntu?(如何修复“没有名为 kivy._clock 的模块Ubuntu中的错误?)
问题描述
我正在尝试使用 Ubuntu 16.04 for Python 3.6 安装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'
推荐答案
在终端试试这个:
- 确保你已经为 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/
复制最新版本的链接,该链接在文件名中具有与您的 python3 版本的前两位数字匹配的
cpXX值.对我来说,这是cp37.Copy the link of the latest build that has a
cpXXvalue 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 安装说明(以及我在哪里找到 nightly wheel 构建链接):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中的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何修复“没有名为 'kivy._clock' 的模块"Ubuntu中的错误?
基础教程推荐
- Discord.py 缺少必需的参数 2022-01-01
- 将 x 轴刻度更改为自定义字符串 2022-01-01
- 由Python将MP3转换为MIDI(类型错误:无法加载插件:mtg-Melodia:Melodia) 2022-01-01
- 尝试制作WhatsApp机器人 2022-01-01
- 使用生成器和迭代器时 Python 多循环失败 2022-01-01
- 用 Python 编写 Fortran 无格式文件 2022-01-01
- 与常规 dict 相比,Python manager.dict() 非常慢 2022-01-01
- numpy float:比算术运算中内置的慢 10 倍? 2022-01-01
- pyserial - 可以从线程 a 写入串行端口,是否阻塞从线程 b 读取? 2022-01-01
- 在 Celery 工作人员中捕获 Heroku SIGTERM 以优雅地关 2022-01-01
