[英]Error in installing python3-tk package
通過鍵入以下內容安裝 python3-tk 時出現以下錯誤:
apt-get install python3-tk
Need to get 34.4 kB of archives.
After this operation, 150 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
python3-tk
Install these packages without verification? [y/N] y
Err http://us.archive.ubuntu.com/ubuntu/ wily/main python3-tk amd64 3.4.3-4
404 Not Found [IP: 91.189.91.26 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python3-stdlib-extensions/python3-tk_3.4.3-4_amd64.deb 404 Not Found [IP: 91.189.91.26 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
I tried to run apt-get update and tried with --fix-missing but of no use. Can anybody help me figure out the way to solve this or provide alternate method to download tkinter for python3 ?
如果您使用的是 Ubuntu,請先嘗試添加 deadsnakes ppa:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
然后,根據類似問題的答案,取決於您使用的 python 版本和項目配置:
為 Python3.xx 安裝 tkinter:
sudo apt-get install python3-tk
對於以 Python 3.5 作為“系統”python 的 Python 3.6 虛擬環境:
sudo apt-get install python3.6-tk
“一般來說,如果一個人使用的 python 版本與基礎機器的版本不同,那么似乎一個人必須為虛擬環境中使用的 python 版本安裝 tk”:
sudo apt install python3.x-tk
“3.x 將匹配虛擬環境的版本。”
您不需要單獨安裝tkinter
。 只需使用from tkinter import *
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.