如何在centos中安装python3-tk?

我需要安装 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-tkinter或python34-tkinter提供,具体取决于操作系统.

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

相关文章

linux下开机自启: 在/etc/init.d目录下新建文件elasticsear...
1、因为在centos7中/etc/rc.d/rc.local的权限被降低了,所以...
最简单的查看方法可以使用ls -ll、ls-lh命令进行查看,当使用...
ASP.NET Core应用程序发布linux在shell中运行是正常的。可一...
设置时区(CentOS 7) 先执行命令timedatectl status|grep &...
vim /etc/sysconfig/network-scripts/ifcfg-eth0 B...