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


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to