通过键入以下命令,我在安装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 ?发布于 2020-04-05 00:44:52
如果您使用的是Ubuntu,请先尝试添加deadsnakes:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update然后,根据similar question的回答,这取决于您使用的python版本和您的项目配置:
为Python3.x.x安装tkinter:
sudo apt-get install python3-tk对于Python 3.6虚拟环境,使用Python 3.5作为“系统”python:
sudo apt-get install python3.6-tk“一般来说,如果使用的虚拟环境的python版本不同于基础机器的版本,则必须为虚拟环境中使用的python版本安装tk”:
sudo apt install python3.x-tk‘其中3.x将与虚拟环境的版本相匹配。’
发布于 2017-09-25 16:28:43
您不需要单独安装tkinter。只需使用from tkinter import *即可
https://stackoverflow.com/questions/46400631
复制相似问题