Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I installed matplotlib on Mac and it was successful. After I type in

import matplotlib.pyplot as plt

in my code I got the following error:

Traceback (most recent call last):
File "q2.py", line 5, in <module>
import matplotlib.pyplot as plt
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.8-intel.egg/matplotlib/pyplot.py", line 26, in <module>
import matplotlib.colorbar
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.8-intel.egg/matplotlib/colorbar.py", line 31, in <module>
import matplotlib.artist as martist
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.8-intel.egg/matplotlib/artist.py", line 10, in <module>
from .transforms import Bbox, IdentityTransform, TransformedBbox, \
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.8-intel.egg/matplotlib/transforms.py", line 38, in <module>
from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: dlopen(/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.8-intel.egg/matplotlib/_path.so, 2): Symbol not found: ___emutls_get_address
Referenced from: /usr/local/lib/libstdc++.6.dylib
Expected in: /usr/local/lib/libgcc_s.1.dylib
in /usr/local/lib/libstdc++.6.dylib

I followed the installation instruction in the link below:

https://github.com/matplotlib/matplotlib/blob/master/README.osx

The installation has no problem. Does anyone know why this would happen?

Thanks!

share|improve this question
1  
This related question might help –  jedwards Sep 21 '13 at 23:04
    
are you using the same python you install matplotlib with? –  tcaswell Sep 22 '13 at 5:48

1 Answer 1

I know this question is a bit stale, but I recently ran into the same issue and couldn't find a solution online. I figured my debugging might help someone else out there...

Apparently there's an incompatibility with the libgcc_s.1.dylib and libstdc++.6.dylib libraries found in /usr/local/lib/. I backed up those files, and then sym linked from the files found in /usr/lib/

sudo mv /usr/local/lib/libgcc_s.1.dylib /usr/local/lib/libgcc_s.1.dylib.old
sudo mv /usr/local/lib/libstdc++.6.dylib /usr/local/lib/libstdc++.6.dylib.old

sudo ln -s /usr/lib/libgcc_s.1.dylib /usr/local/lib/libgcc_s.1.dylib
sudo ln -s /usr/lib/libstdc++.6.dylib /usr/local/lib/libstdc++.6.dylib

I'm now able to import pyplot :)

share|improve this answer
    
Excellent. I was getting this error ImportError: dlopen(/usr/local/lib/python2.7/site-packages/cv2.so, 2): Symbol not found: ___emutls_get_address Referenced from: /usr/local/lib/libstdc++.6.dylib Expected in: /usr/lib/libSystem.B.dylib in /usr/local/lib/libstdc++.6.dylib and moving and linking the libstdc++ dylibs in your answer fixed it. –  AGS Feb 6 at 3:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.