Basic matplotlib configuration question

I just installed the windows prebuilt packages for Python 2.5 for:
numpy, scipy and finally matplotlib. I get the following import problem:

>>> import pylab
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "C:\Python25\Lib\site-packages\pylab.py", line 1, in <module>
    from matplotlib.pylab import *
  File "C:\Python25\Lib\site-packages\matplotlib\__init__.py", line 129, in <module>
    from rcsetup import defaultParams, validate_backend, validate_toolbar
  File "C:\Python25\Lib\site-packages\matplotlib\rcsetup.py", line 19, in <module>
    from matplotlib.colors import is_color_like
  File "C:\Python25\Lib\site-packages\matplotlib\colors.py", line 54, in <module>
    import matplotlib.cbook as cbook
  File "C:\Python25\Lib\site-packages\matplotlib\cbook.py", line 10, in <module>
    import numpy.ma as ma
ImportError: No module named ma

How do I install to be able to import pylab?

David Lees

2009/1/7 David Lees <debl2@...2440...>:
I just installed the windows prebuilt packages for Python 2.5 for:
numpy, scipy and finally matplotlib. I get the following import problem:

>>> import pylab
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Python25\Lib\site-packages\pylab.py", line 1, in <module>
   from matplotlib.pylab import *
File "C:\Python25\Lib\site-packages\matplotlib\__init__.py", line 129,
in <module>
   from rcsetup import defaultParams, validate_backend, validate_toolbar
File "C:\Python25\Lib\site-packages\matplotlib\rcsetup.py", line 19,
in <module>
   from matplotlib.colors import is_color_like
File "C:\Python25\Lib\site-packages\matplotlib\colors.py", line 54, in
<module>
   import matplotlib.cbook as cbook
File "C:\Python25\Lib\site-packages\matplotlib\cbook.py", line 10, in
<module>
   import numpy.ma as ma
ImportError: No module named ma

Sounds like there's a problem with your Numpy install. Matplotlib
doesn't depend on Scipy.

What is the result of typing the following at your Python prompt?

import numpy
numpy.__version__

import matplotlib
matplotlib.__version__

Cheers,
Scott

Scott Sinclair wrote:


 2009/1/7 David Lees :
I just installed the windows prebuilt packages for Python 2.5 for:
numpy, scipy and finally matplotlib. I get the following import problem:
>>> import pylab
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Python25\Lib\site-packages\pylab.py", line 1, in <module>
from matplotlib.pylab import *
File "C:\Python25\Lib\site-packages\matplotlib\__init__.py", line 129,
in <module>
from rcsetup import defaultParams, validate_backend, validate_toolbar
File "C:\Python25\Lib\site-packages\matplotlib\rcsetup.py", line 19,
in <module>
from matplotlib.colors import is_color_like
File "C:\Python25\Lib\site-packages\matplotlib\colors.py", line 54, in
<module>
import matplotlib.cbook as cbook
File "C:\Python25\Lib\site-packages\matplotlib\cbook.py", line 10, in
<module>
import numpy.ma as ma
ImportError: No module named ma

Sounds like there's a problem with your Numpy install. Matplotlib
doesn't depend on Scipy.
What is the result of typing the following at your Python prompt?
import numpy
numpy.__version__

import matplotlib
matplotlib.__version__
Cheers,
Scott
<snip>

Scott,

Thank you for your dead-on correct answer. I indeed had version 1.0.4
of numpy, even after running the Windows uninstaller from the control
panel and running the installer for numpy 1.2.1. I had to go in and
manually remove directories and then I was finally able to rerun the
numpy installer and now I can import pylab. Could installing the
latest scipy on Windows also have been my problem?

David Lees

···

<debl2@…2440…>