I\'ve installed Anaconda with the pkg installer:
Python 2.7.10 |Continuum Analytics, Inc.| (default, May 28 2015, 17:04:42)
[GCC 4.2.1 (Apple Inc. build 557
I was having the same problem with anaconda 2 & matplotlib 1.5.3.
Running a simple conda install matplotlib
to reinstall matplotlib did the trick for me.
If you experience this error, don't forget to check your bash_profile.
You can do this in terminal by:
cd
then
nano .bash_profile
check the contents. Macports and Homebrew add their own headings for things they've done here. You can remove the declarations they make to $PATH. Just leave the one Anaconda has made. I had a If you would like, you can:
cp .bash_profile ./bash_profile_backup_yyyy_mm_dd
and have a backup of the file, with filename indexing to the date you changed it. That is, provided you actually put in the date in instead of just the formatting characters I'm suggesting.
source ~/.bash_profile
will refresh your system's reference to the bash_profile and you should be good to go in importing and using matplotlib
Quickfix: Run your file using pythonw, instead of python.
e.g pythonw testFile.py.
Posting since I just had this issue and this was a quick fix:
If you used pip to install:
Create ~/.matplotlib/matplotlibrc
Add "backend: TkAgg
" (without the quotations) to the file.