tkinter.TclError: no display name and no $DISPLAY environment variable export MPLBACKEND=Agg 在matplotlib画图时出现问题,简单的解决方案是临时添加变量。先在命令行打上面export,再运行程序。