From: LANDRIU D. S. <la...@di...> - 2006-08-30 12:52:22
|
Hello, =20 I come back to my question : how to use numarray=20 with the numpy installation ? =20 =20 After some update in the system there is another=20 error message : >> AttributeError: 'module' object has no attribute 'NewAxis' It seems , from advice of the system manager, that an kind of=20 alias failed to execute the right action. =20 Thanks in advance for your answer, Cheers, =20 David Landriu ------------- Begin Forwarded Message ------------- >Date: Wed, 30 Aug 2006 14:14:27 +0200 (MEST) >To: LANDRIU David SAp <la...@di...> >Subject: Re: Use of numarray from numpy package [# INC NO 24609] >From: User Support <use...@cc...> >Error-to: Jean-Rene Rouet <ro...@in...> >X-CEA-Source: externe >X-CEA-DebugSpam: 7% >X-CEA-Spam-Report: No antispam rules were triggered by this message >X-CEA-Spam-Hits: __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __SANE_MSGID 0, __STOC= K_CRUFT 0 >MIME-Version: 1.0 >Content-Transfer-Encoding: 8bit >X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on discovery >X-Spam-Status: No, hits=3D0.1 required=3D4.0 tests=3DAWL autolearn=3Dno ve= rsion=3D2.63 >X-Spam-Level:=20 > > >R=E9ponse de User-Support =E0 votre question : >------------------------------------------ > >Rebonjour >Essayez maintenat svp > >WW Voici ce que j'obtiens maintenant : {ccali22}~(0)>setenv PYTHONPATH /usr/local/lib/python2.3/site-packages/nump= y {ccali22}~(0)> {ccali22}~(0)> {ccali22}~(0)>python Python 2.3.5 (#2, Oct 17 2005, 17:20:02) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-52)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from numarray import * Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'module' object has no attribute 'NewAxis' >>> ############################################## ############################################## Hello, is it necessary to install numarray separately to use numpy ? =20 Indeed, after numpy installation, when I try to use it in the code, I get the same error as below : =20 .../...=20 Python 2.4.1 (#1, May 13 2005, 13:45:18) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-42)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from numarray import * Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/local/lib/python2.3/site-packages/numpy/numarray/__init__.py",= line 1, in ? from util import * File "/usr/local/lib/python2.3/site-packages/numpy/numarray/util.py", lin= e 2, in ? from numpy import geterr ImportError: No module named numpy >>> Thanks for your answer, =20 Cheers, =20 David Landriu =20 -------------------------------------------------------------------- David Landriu DAPNIA/SAp CEA SACLAY (France) = =20 Phone : (33|0)169088785=20 Fax : (33|0)169086577=20 --------------------------------------------------------------------- |
From: Joris De R. <jo...@st...> - 2006-08-30 13:43:13
|
Hi David, Numeric, numarray and numpy are three different packages that can live independently, but that can also coexist if you like so. If you're new to this packages, you should stick to numpy, as the other ones are getting phased out. It's difficult to see what's going wrong without having seen how you installed it. I see that you tried >>> from numarray import * Perhaps a stupid question, but you did import numpy with >>> from numpy import * didn't you? Cheers, Joris Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm |
From: Perry G. <pe...@st...> - 2006-08-30 14:43:50
|
On Aug 30, 2006, at 8:51 AM, LANDRIU David SAp wrote: > Hello, > > I come back to my question : how to use numarray > with the numpy installation ? > If you are using both at the same time, one thing you don't want to do is from numpy import * from numarray import * You can do that with one or the other but not both. Are you doing that? Perry Greenfield |
From: Andrew S. <str...@as...> - 2006-08-30 16:13:24
|
LANDRIU David SAp wrote: > Hello, > > I come back to my question : how to use numarray > with the numpy installation ? > > {ccali22}~(0)>setenv PYTHONPATH /usr/local/lib/python2.3/site-packages/numpy > Here's where you went wrong. You want: setenv PYTHONPATH /usr/local/lib/python2.3/site-packages > {ccali22}~(0)>python > Python 2.3.5 (#2, Oct 17 2005, 17:20:02) > [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-52)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>> from numarray import * >>>> > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File "/usr/local/lib/python2.3/site-packages/numpy/numarray/__init__.py", line 1, in ? > from util import * > File "/usr/local/lib/python2.3/site-packages/numpy/numarray/util.py", line 2, in ? > from numpy import geterr > ImportError: No module named numpy > Note that you're actually importing a numarray within numpy's directory structure. That's because of your PYTHONPATH. numpy ships numpy.numarray to provide backwards compatibility. To use it, you must do "import numpy.numarray as numarray" Cheers! Andrew |
From: Sebastian H. <ha...@ms...> - 2006-08-31 05:11:12
|
Andrew Straw wrote: > LANDRIU David SAp wrote: >> Hello, >> >> I come back to my question : how to use numarray >> with the numpy installation ? >> >> {ccali22}~(0)>setenv PYTHONPATH /usr/local/lib/python2.3/site-packages/numpy >> > Here's where you went wrong. You want: > > setenv PYTHONPATH /usr/local/lib/python2.3/site-packages > >> {ccali22}~(0)>python >> Python 2.3.5 (#2, Oct 17 2005, 17:20:02) >> [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-52)] on linux2 >> Type "help", "copyright", "credits" or "license" for more information. >> >>>>> from numarray import * >>>>> >> Traceback (most recent call last): >> File "<stdin>", line 1, in ? >> File "/usr/local/lib/python2.3/site-packages/numpy/numarray/__init__.py", line 1, in ? >> from util import * >> File "/usr/local/lib/python2.3/site-packages/numpy/numarray/util.py", line 2, in ? >> from numpy import geterr >> ImportError: No module named numpy >> > > Note that you're actually importing a numarray within numpy's directory > structure. That's because of your PYTHONPATH. numpy ships numpy.numarray > to provide backwards compatibility. To use it, you must do "import > numpy.numarray as numarray" > Just to explain -- there is only a numarray directory inside numpy to provide some special treatment for people that do the transition from numarray to numpy - meaning: they can do somthing like from numpy import numarray and get a "numpy(!) version" that behaves more like numarray than the straight numpy ... Similar for "from numarray import oldnumaric as Numeric" (for people coming from Numeric ) Yes - it is actually confusing, but that's the baggage when there are 2 (now 3) numerical python packages is human history. The future will be much brighter - forget all of the above, and just use import numpy (I like "import numpy as N" for less typing - others prefer even "from numpy import *" ) Hope that helps, - Sebastian Haase |
From: Christopher B. <Chr...@no...> - 2006-08-30 17:19:00
|
Andrew Straw wrote: >> {ccali22}~(0)>setenv PYTHONPATH /usr/local/lib/python2.3/site-packages/numpy >> > Here's where you went wrong. You want: > > setenv PYTHONPATH /usr/local/lib/python2.3/site-packages Which you shouldn't need at all. site-packages should be on sys.path by default. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |