How to fix “No module named 'kivy._clock'” error in ubuntu?

匆匆过客 提交于 2020-01-15 01:40:06

问题


I'm trying to install "kivy" (GUI lib) with Ubuntu 16.04 for Python 3.6

I tried doing the steps in the kivy official website (https://kivy.org/doc/stable/installation/installation-linux.html)

I entered in the terminal:

sudo add-apt-repository ppa:kivy-team/kivy
sudo apt-get update
sudo apt-get install python3-kivy

And when I tried to import:

from kivy.app import App

I get the error:

ModuleNotFoundError: No module name 'kivy._clock'

回答1:


Try this in terminal:

  • Make sure you have pip installed for python3

$ sudo apt-get install python3-pip

  • Uninstall python3-kivy

$ sudo apt-get purge python3-kivy

  • Figure out your python3 version; note the first two digits:

$ python3 -V

Output:

Python 3.7.3

  • Find the latest build nightly build / wheels links here: https://kivy.org/downloads/ci/linux/kivy/

    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


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:

  • For determining compatible cython versions: https://kivy.org/doc/stable/installation/deps-cython.html

  • For the linux install instructions (and where I found the nightly wheels build link): https://kivy.org/doc/stable/installation/installation-linux.html



来源:https://stackoverflow.com/questions/54356513/how-to-fix-no-module-named-kivy-clock-error-in-ubuntu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!