2

So I wiped Python 3.6 some weeks ago and seem to have incorrectly reinstalled matplotlib etc because I've been getting a bunch of errors for different things.

I'm trying to run a script that displays a number of images side by side using subplot. Tried it from the command line, worked fine. But when I write it all up in a script and try to run it (I have about 24 images) I get the following error:

You probably need to get an updated matplotlibrc file from http://github.com/matplotlib/matplotlib/blob/master/matplotlibrc.template or from the matplotlib source distribution Traceback (most recent call last): File "./merge_pics.py", line 8, in fig=plt.figure() File "/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 527, in figure **kwargs) File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 84, in new_figure_manager return new_figure_manager_given_figure(num, figure) File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 101, in new_figure_manager_given_figure icon_img = Tk.PhotoImage(file=icon_fname) File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 3370, in init Image.init(self, 'photo', name, cnf, master, **kw) File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 3324, in init self.tk.call(('image', 'create', imgtype, name,) + options) _tkinter.TclError: couldn't open "/usr/share/matplotlib/mpl-data/images/matplotlib.gif": no such file or directory

When I click on the link I can't tell where I'm supposed to get the updated matplotlibrc file.

I have tried wget http://github.... but still get the same error

Matplotlib is definitely installed because trying to plot simple things is working so I can't figure out what's going wrong

2
  • Such an error would not happen if matplotlib is correctly installed. Now it's very hard to know what went wrong with your installation. I guess the aim would be to remove matplotlib completely and do a clean reinstall. Commented Dec 17, 2018 at 11:41
  • How would one go about removing matplotlib? Commented Dec 17, 2018 at 15:03

1 Answer 1

3

I have tried and fixed this error successfully. Firstly, you should uninstall matplotlib by

pip uninstall matplotlib

Then, you install it again by

pip install matplotlib

Feel free to ask more.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.