2

I recently reinstalled Python using Anaconda (Python 2.7) package, as a result I could not use Matplotlib anymore. I am using the Jupyter notebook 4.2.1 and also tried to run the code in Spyder 2.3.9.

In both cases I get the same result when I type the following command:

import matplotlib.pyplot as plt

plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.show()

Exception in Tkinter callback Traceback (most recent call last):
File "/Users/Anatoly/anaconda/lib/python2.7/lib-tk/Tkinter.py", line 1537, in call return self.func(*args) File "/Users/Anatoly/anaconda/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 283, in resize self.show() File "/Users/Anatoly/anaconda/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 355, in draw tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2) File "/Users/Anatoly/anaconda/lib/python2.7/site-packages/matplotlib/backends/tkagg.py", line 30, in blit id(data), colormode, id(bbox_array)) TclError

Could you help me to figure out what is going on? I already reinstalled Matplotlib and it did not help.

J.J. Hakala
  • 6,136
  • 6
  • 27
  • 61
Anat
  • 21
  • 2
  • What if you uninstall both. Reinstall and try again. You may have a version mismatch. – Paul Rooney Jul 19 '16 at 02:55
  • http://stackoverflow.com/questions/35145314/tclerror-matplotlib-1-5-0 – dsgdfg Jul 19 '16 at 05:45
  • Finally I found the solution. I just had another .matplotlib installed not in the conda folder. I removed the non-working version of it using these instructions: http://matplotlib.org/faq/installing_faq.html#how-to-completely-remove-matplotlib Then it works fine, when I use matplotlib provided by conda package. Addition of matplotlib.use('TkAgg') did not help – Anat Jul 20 '16 at 05:05
  • http://stackoverflow.com/questions/34405087/why-is-pyplot-giving-me-a-tclerror-on-osx – Zhenyu Wu Jan 31 '17 at 03:05

0 Answers0