問題描述
我正在嘗試使用 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 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中的錯誤?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!