0

The full error:

import matplotlib
Traceback (most recent call last):
 File "<pyshell#0>", line 1, in <module>
    import matplotlib
  File "R:\Python34\lib\site-packages\matplotlib\__init__.py", line 180, in <module>
    from matplotlib.cbook import is_string_like
  File "R:\Python34\lib\site-packages\matplotlib\cbook.py", line 34, in <module>
    import numpy.ma as ma
ImportError: No module named 'numpy.ma'

numpy is imported normally. How do I install numpy.ma?

ali_m
  • 71,714
  • 23
  • 223
  • 298
  • What version of numpy are you using? Do check this post: http://stackoverflow.com/questions/7818811/import-error-no-module-named-numpy – karthikr Mar 25 '15 at 14:23
  • How did you install numpy and matplotlib? Masked arrays have been supported since numpy v1.3 which was released in 2008, so unless you have an *extremely* old version of numpy then there is probably an issue with the installation. – ali_m Mar 25 '15 at 15:29
  • It was probably a faulty install. I re-installed and it's fine now. –  Mar 25 '15 at 16:17

3 Answers3

2

I also faced the same situation today. I found that I had saved a file as numpy.py, so check the filenames in your folder.

cheersmate
  • 2,385
  • 4
  • 19
  • 32
0

Re-install the correct version of numpy.

download correct .whl file from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

pip install C:\Path\To\Wheel\Filename.whl # for example: numpy-1.9.2+mkl-cp34-none-win_amd64.whl
-1

Use Your (via terminal) package manager and search.

Example on Ubuntu: aptitude search numpy

and install package.

In my case:

apt-get install python-numpy
lunaferie
  • 401
  • 3
  • 7