因此,几周前我删除了Python3.6,并且似乎错误地重新安装了matplotlib等等,因为我在不同的方面得到了很多错误。
我正在尝试运行一个脚本,它使用子图并行地显示多个图像。从命令行试过了,效果很好。但是,当我用脚本编写并尝试运行它(我有大约24张图片)时,我会得到以下错误:
您可能需要从matplotlib源分布跟踪(最近一次调用):"/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py","./merge_pics.py“第8行( fig=plt.figure() http://github.com/matplotlib/matplotlib/blob/master/matplotlibrc.template第527行,图**kwargs)文件"/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py",第84行获得更新的matplotlibrc文件。在"/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py",new_figure_manager返回new_figure_manager_given_figure(num,图)文件的第101行中,在new_figure_manager_given_figure icon_img = Tk.PhotoImage(file=icon_fname) File "/usr/lib/python2.7/lib-tk/Tkinter.py“中,第3370行,在init Image.init(self,的照片中,名称,cnf,**kw) File "/usr/lib/python2.7/lib-tk/Tkinter.py",第3324行,在init self.tk.call(('image','create',imgtype,name,)+ options) _tkinter.TclError:未能打开任何这样的文件或目录
当我单击该链接时,我无法知道应该从何处获取更新的matplotlibrc文件。
我试过wget http://github..。但仍然有相同的错误
Matplotlib的安装是肯定的,因为试图绘制简单的东西是可行的,所以我不知道出了什么问题
发布于 2020-09-05 20:19:37
我已经成功地尝试并修正了这个错误。首先,您应该卸载matplotlib
pip uninstall matplotlib
然后,您重新安装它
pip install matplotlib
请多问几句。
https://stackoverflow.com/questions/53804577
复制