gpt4 book ai didi

python - 安装 python3-tk 包时出错

转载 作者:行者123 更新时间:2023-12-04 18:34:54 24 4
gpt4 key购买 nike

通过键入以下命令安装 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

然后,根据 similar question 的回答,取决于您使用的 python 版本和您的项目配置:

为 Python3.x.x 安装 tkinter:
sudo apt-get install python3-tk

对于以 Python 3.5 作为“系统”python 的 Python 3.6 虚拟环境:
sudo apt-get install python3.6-tk

'一般来说,如果一个虚拟环境使用的 python 版本与基 native 器不同,则必须为虚拟环境中使用的 python 版本安装 tk':
sudo apt install python3.x-tk

“3.x 将匹配虚拟环境的版本。”

关于python - 安装 python3-tk 包时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46400631/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com