[Numpy-discussion] ImportError: No module named ma
Howdy, I'm trying to run some scripts associated with a paper I was reading. They use the matplotlib to generate figures which in turn calles numpy. I'm new to python, but I'm very familiar with perl. I'm getting the following error, and I'm not quite sure what is causing it. Can anyone here offer any suggestions? [EMAIL PROTECTED]:$ python2.5 Bb-plot.py Traceback (most recent call last): File Bb-plot.py, line 7, in module from pylab import * File /Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5.egg/pylab.py, line 1, in module from matplotlib.pylab import * File /Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5.egg/matplotlib/__init__.py, line 128, in module from rcsetup import defaultParams, validate_backend, validate_toolbar File /Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5.egg/matplotlib/rcsetup.py, line 19, in module from matplotlib.colors import is_color_like File /Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5.egg/matplotlib/colors.py, line 39, in module import matplotlib.cbook as cbook File /Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5.egg/matplotlib/cbook.py, line 9, in module import numpy.ma as ma ImportError: No module named ma -- John M Harrold ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] ImportError: No module named ma
On Tuesday 07 October 2008 15:23:58 John Harrold wrote: /Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5.egg/matplotlib/c book.py, line 9, in module import numpy.ma as ma ImportError: No module named ma John, Are you sure you have numpy installed ? What version do you have ? ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] ImportError: No module named ma
Hi John 2008/10/7 John Harrold [EMAIL PROTECTED]: I'm trying to run some scripts associated with a paper I was reading. They use the matplotlib to generate figures which in turn calles numpy. I'm new to python, but I'm very familiar with perl. I'm getting the following error, and I'm not quite sure what is causing it. Can anyone here offer any suggestions? [EMAIL PROTECTED]:$ python2.5 Bb-plot.py Traceback (most recent call last): File Bb-plot.py, line 7, in module from pylab import * File /Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5.egg/pylab.py, line 1, in module from matplotlib.pylab import * File /Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5.egg/matplotlib/__init__.py, line 128, in module from rcsetup import defaultParams, validate_backend, validate_toolbar File /Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5.egg/matplotlib/rcsetup.py, line 19, in module from matplotlib.colors import is_color_like File /Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5.egg/matplotlib/colors.py, line 39, in module import matplotlib.cbook as cbook File /Library/Python/2.5/site-packages/matplotlib-0.98.3-py2.5.egg/matplotlib/cbook.py, line 9, in module import numpy.ma as ma ImportError: No module named ma Could you give us the version of NumPy that you are using? import numpy print numpy.__version__ As far as I recall, the masked array module was always available as numpy.ma, but maybe I'm wrong. Could you try the following: import numpy print numpy.core.ma Thanks! Stéfan ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] ImportError: No module named ma
John Harrold wrote: This should answer both of your questions: import numpy print numpy.__version__ 1.0.1 print numpy.core.ma module 'numpy.core.ma' from '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/numpy/core/ma.pyc' I actually installed 1.2.0 using the installation package for OS X. However, I have no idea where it was installed to and how to instruct python to use the new one over the old. the installation package for OS-X is for the python.org build -- from the above, I can see you are running Apple's python, which came with a version of numpy. I don't remember how you installed matplotlib, but in general, most extrenal packages are built for the python or python, so what I wold do is: download and install python 2.5.2 from python.org (2.6 is brand new, and not yet well supported by external packages) re-install numpy 1.2.0 (may not be necessary, but it won't hurt) re-install MPL. you can tell what python you are running by typing python n the command line -- it should be 2.5.2 if it's the python.org one. If that's not what you get, you may need to edit your .bash_profile file to add it to your PATH. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] ImportError: No module named ma
Sometime in October, Christopher Barker proposed the following: | the installation package for OS-X is for the python.org build -- from | the above, I can see you are running Apple's python, which came with a | version of numpy. | | I don't remember how you installed matplotlib, but in general, most | extrenal packages are built for the python or python, so what I wold do is: | | download and install python 2.5.2 from python.org (2.6 is brand new, and | not yet well supported by external packages) | | re-install numpy 1.2.0 (may not be necessary, but it won't hurt) | | re-install MPL. | | you can tell what python you are running by typing python n the | command line -- it should be 2.5.2 if it's the python.org one. If that's | not what you get, you may need to edit your .bash_profile file to add it | to your PATH. | Thanks Chris, This worked great. Along with the above mentioned stuff, I also had a bit of trouble installing the MPL egg which seems to be mac specific. This was also pretty useful in fixing that: http://www.nabble.com/OS-X-(Intel-Mac)-installation-woes-td19011120.html The important part being: That said, the build on the matplotlib website is self-sufficient save for numpy, use the -N flag to easy_install (and don't forget to run it with sudo). This should take care of things. -- John M Harrold ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion