>>> import matplotlib.pyplot as plt
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'
原因是:没有安装tkinter包
ubutun16下的解决方案是:
sudo apt-get install tk8.6-dev
进入到python的安装目录下:
make
sudo make install
然后输入python进入shell:
import thinter #不报错表示安装成功!