我需要安装 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 ~]$
原文由 Donbeo 发布,翻译遵循 CC BY-SA 4.0 许可协议
tkinter 在 coreos 中作为
tkinter
包提供。你可以安装它完成后,您可以像往常一样导入和使用它。
对于 Python 3,你可以安装它
正如一些用户提到的,它可以用作
python36u-tkinter
或python34-tkinter
取决于操作系统。