如何修复“没有名为 'kivy._clock' 的模块"Ubuntu中的错误?

How to fix quot;No module named #39;kivy._clock#39;quot; error in ubuntu?(如何修复“没有名为 kivy._clock 的模块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 cpXX value in the file name that matches the first two digits of your python3 version. For me, this is cp37.

    最后把链接放到下一条命令的相关部分:

    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中的错误?