ubuntu 18.04 python3.6 Matplotlib后端是 Agg 的问题 import matplotlib matplotlib.use('TkAgg') matplotlib 教程 原地址 没有tk包的问题 在terminal中 sudo apt-get install python3-tk