gpt4 book ai didi

python - 如何在centos中安装python3-tk?

转载 作者:太空狗 更新时间:2023-10-29 17:53:39 24 4
gpt4 key购买 nike

我需要安装 python3-tk 才能使用 matplotlib。

I have tried: 

(python_3.4_numerical) [lpuggini@machinelearn-1 ~]$ sudo yum install python3-tk
[sudo] password for lpuggini:
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.clouvider.net
* epel: epel.check-update.co.uk
* extras: mirror.sov.uk.goscomb.net
* updates: mirrors.clouvider.net
No package python3-tk available.
Error: Nothing to do
(python_3.4_numerical) [lpuggini@machinelearn-1 ~]$

但它不起作用。

我该如何解决?

编辑:从 pip 安装不起作用:

(python_3.4_numerical) [lpuggini@machinelearn-1 ~]$ pip install pygtk
Collecting pygtk
Using cached pygtk-2.24.0.tar.bz2
Complete output from command python setup.py egg_info:
********************************************************************
* Building PyGTK using distutils is only supported on windows. *
* To build PyGTK in a supported way, read the INSTALL file. *
********************************************************************

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-nzjsuhx3/pygtk/
(python_3.4_numerical) [lpuggini@machinelearn-1 ~]$

最佳答案

tkinter 在 coreos 中作为 tkinter 包可用。您可以使用

安装它
sudo yum install tkinter

完成后,您可以像往常一样导入和使用它。

>>> import tkinter
>>> tkinter._test()

对于 Python 3,你可以安装它

sudo yum install python3-tkinter

正如一些用户提到的,它可以作为 python36u-tkinterpython34-tkinter 来使用,具体取决于操作系统。

sudo yum install python34-tkinter
sudo yum install python36u-tkinter

关于python - 如何在centos中安装python3-tk?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40588444/

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