Matplotlib python3.6无法导入tkinter&;python3.6的tkinker安装位置

Matplotlib python3.6无法导入tkinter&;python3.6的tkinker安装位置,matplotlib,tkinter,python-3.6,Matplotlib,Tkinter,Python 3.6,我试图使用python3.6导入matplotlib.pyplot,但出现错误 ModuleNotFoundError:没有名为“\u tkinter”的模块 直接在python脚本中导入tkinter会产生相同的错误 我也尝试过安装tkinter,但仍然无法在python3.6中导入 $ sudo apt-get install python3-tk Reading package lists... Done Building dependency tree Reading st

我试图使用python3.6导入matplotlib.pyplot,但出现错误

ModuleNotFoundError:没有名为“\u tkinter”的模块

直接在python脚本中导入tkinter会产生相同的错误

我也尝试过安装tkinter,但仍然无法在python3.6中导入

$ sudo apt-get install python3-tk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-tk is already the newest version (3.5.1-1).
The following packages were automatically installed and are no longer required:
  libexpat1:i386 libmpdec2:i386 libpython3-dev libpython3-stdlib:i386 libpython3.5-dev libpython3.5-minimal:i386
  libpython3.5-stdlib:i386 libreadline6:i386 libsnapd-glib1 libsqlite3-0:i386 libssl1.0.0:i386 linux-headers-4.13.0-36
  linux-headers-4.13.0-36-generic linux-headers-4.13.0-37 linux-headers-4.13.0-37-generic linux-headers-4.13.0-38
  linux-headers-4.13.0-38-generic linux-image-4.13.0-36-generic linux-image-4.13.0-37-generic linux-image-4.13.0-38-generic
  linux-image-extra-4.13.0-36-generic linux-image-extra-4.13.0-37-generic linux-image-extra-4.13.0-38-generic
  linux-signed-image-4.13.0-37-generic linux-signed-image-4.13.0-38-generic snapd-login-service
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

$ python
Python 3.6.3 (default, Apr 13 2018, 13:00:29) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/tkinter/__init__.py", line 36, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'
使用python2.7和3.5时,Matplotlib和tkinter工作良好。我想问题在于为python3.6安装tkinker,但我没有安装它


谢谢

也许会帮助您?@BillalBEGUERADJ答案允许我导入matplotlib而不会出错,但仍然无法使用plt.show()直观地生成绘图。所以我可能还是想安装tkinter。
 $ sudo apt-get install python3.6-tk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python3.6-tk
E: Couldn't find any package by glob 'python3.6-tk'
E: Couldn't find any package by regex 'python3.6-tk'