1

I'm having trouble getting matplotlib up and running. I've downloaded it, but when I try to run the test command python -c 'import matplotlib; print matplotlib.__version__, matplotlib.__file__' I get the following errors

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/__init__.py", line 135, in <module>
    from matplotlib.rcsetup import (defaultParams,
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 19, in <module>
    from matplotlib.colors import is_color_like
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/colors.py", line 52, in <module>
    import numpy as np
ImportError: No module named numpy

I know I have numpy installed, as I've used numpy and can work with it. import numpy in the python shell works just fine.

Maybe this is a PATH issue, but I'm not really sure.

Thanks

5
  • 1
    You probably have numpy installed into python 2.6 Commented Jan 25, 2011 at 4:44
  • Sure, but how would you recommend I procede? Uninstall 2.6 and numpy, then reinstall numpy on 2.7? Install numpy on 2.6 and 2.7 (how?) Somehow tell matlabplot to look at the correct place? Commented Jan 25, 2011 at 4:47
  • @tshauk: I would recommend that you try that. If that still doesn't work, then try using sys.path.append to manually append the numpy path to the PATH Commented Jan 25, 2011 at 5:51
  • Voted up because I was reading numpy as "numb-pee" and I was like, WTF is numb-pee?! Commented Jun 15, 2012 at 18:11
  • pip3 install --user numpy matplotlib Commented Jan 24, 2022 at 15:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.