What does this (matplotlib) error message mean?
Question: Display is the module:

    
    
    import matplotlib
    matplotlib.use('TkAgg')   #TkAgg is quite slow but should work on all platforms.
    
    import time
    import numpy
    import matplotlib.pyplot as plt  
    
    def display_2d_array(arr):
        '''Display a square 2D numpy array as a greyscale image.'''
        assert len(arr.shape) == 2 and arr.shape[0] == arr.shape[1]
        plt.ion()
        plt.clf()
        plt.imshow(arr,origin="lower",extent=[0,arr.shape[0],0,arr.shape[0]])
       plt.gray()
       plt.draw()
       raw_input('Hit enter to continue.')
    

But when I call it in a module I get:

    
    
    File "/Users/tomkimpson/display.py", line 8, in <module>
    import matplotlib.pyplot as plt  
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site                  packages/matplotlib/pyplot.py", line 26, in <module>
    from matplotlib.figure import Figure, figaspect
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-  packages/matplotlib/figure.py", line 24, in <module>
    import matplotlib.artist as martist
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/artist.py", line 7, in <module>
    from transforms import Bbox, IdentityTransform, TransformedBbox, \
     File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/transforms.py", line 35, in <module>
    from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
    ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-  packages/matplotlib/_path.so, 2): no suitable image found.  Did find:
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-   packages/matplotlib/_path.so: no matching architecture in universal wrapper
    

Anyone any idea what this means?!


Answer: It looks like you're running this on OS X. Take a look at this [this
question](http://stackoverflow.com/questions/7157330/problem-importing-
matplotlib-mlab-and-pyplot-in-python-2-7-on-mac-osx-10-6), where another OS X
user had your same error. Your matplotlib install is probably corrupted. The
marked answer in question linked to [this
page](http://telliott99.blogspot.com/2011/07/matplotlib-on-os-x-lion-
revised.html), which details how to install matplotlib on OS X.

