1

I was using IPython from Anaconda distribution importing matplotlib without any problem:

import matplotlib.pyplot as plt

However recently I started to get ImportErrors. The first one was related to this question and solution: import matplotlib.pyplot gives ImportError: dlopen(…) Library not loaded libpng15.15.dylib.

That was fixed, but now I am facing the following error and cannot find any solution:

ImportError                               Traceback (most recent call last)
<ipython-input-1-4512b8a694c7> in <module>()
      3 import scipy as sp
      4 import scipy.stats
----> 5 import matplotlib.pyplot as plt
      6 from collections import *
      7 import numpy as np

/Users/jorge/anaconda/lib/python2.7/site-packages/matplotlib/pyplot.py in <module>()
    107 
    108 from matplotlib.backends import pylab_setup
--> 109 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
    110 
    111 

/Users/jorge/anaconda/lib/python2.7/site-packages/matplotlib/backends/__init__.pyc in pylab_setup()
     30     # imports. 0 means only perform absolute imports.
     31     backend_mod = __import__(backend_name,
---> 32                              globals(),locals(),[backend_name],0)
     33 
     34     # Things we pull in from all backends

/Users/jorge/anaconda/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py in <module>()
     22 
     23 import matplotlib
---> 24 from matplotlib.backends import _macosx
     25 
     26 

ImportError: dlopen(/Users/jorge/anaconda/lib/python2.7/site-packages/matplotlib/backends/_macosx.so, 2): Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /Users/jorge/anaconda/lib/libjpeg.8.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Community
  • 1
  • 1
George
  • 171
  • 1
  • 1
  • 8
  • Can you tell us what instructions you followed in the linked question? Interestingly, OP solved his problem by misreading my instructions. I would not recommend pip installing `matplotlib` on OSX. There are so many things that can go wrong. – cel Jun 28 '15 at 06:30
  • Do you know what caused it to break? If it was a conda command, you can see your conda history with `conda list --revisions`. – asmeurer Jun 29 '15 at 16:31
  • Yes @cel I followed the following instructions: _...Try uninstalling with conda remove matplotlib and pip uninstall matplotlib and then see if conda install matplotlib solves this issue. – cel Mar 4 at 7:16_ – George Jun 30 '15 at 16:11
  • @asmeurer I'm not sure about the answer to your question. I have the same problem at home and at work so I suppose it was an update because it was working Ok. I don't think it was a conda command, because I always run the launcher and start IPython from there. I suspect of an installation conflict because I had time before installed IPython "by hand" until I discovered Anaconda. Thanks for your replies. – George Jun 30 '15 at 16:33

0 Answers0