numarray fehlerhaft installoert?
Verfasst: Freitag 12. Januar 2007, 18:10
Hallo,
ich habe ein Problem mit Python, im speziellen mit den Numerik-Paketen, die in Python eingebunden werden sollen.
Mit dem Fileinhalt, er ist den Übungsunterlagen entnommen,
*** File-Begin Testfile.py
from Numeric import *
from numarray import *
from numpy import *
from LinearAlgebra import *
n=4
A=zeros(n*n,float);A.shape=(n,n)
b=zeros(n,float);x=zeros(n,float)
for i in range(n):
x=i/2.0
for j in range(n):
A[i,j]=2.0+float(i+1)/float(j+i+1)
b=matrixmultiply(A,x)
y=solve_linear_equations(A,b)
if abs(sum(x-y)) < 1.0E-10:
print "correct solution"
*** File-Ende Testfile.py
erhalte ich:
*** Meldung-Beginn
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
****************************************************************
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
****************************************************************
IDLE 1.1.3 >>> ================================ RESTART ================================
>>>
Traceback (most recent call last):
File "E:\TU Wien\ILFB_Seminar\2006\Testfile.py", line 18, in -toplevel-
y=solve_linear_equations(A,b)
File "D:\Programme\Python24\Lib\site-packages\Numeric\LinearAlgebra.py", line 88, in solve_linear_equations
t =_commonType(a, b)
File "D:\Programme\Python24\Lib\site-packages\Numeric\LinearAlgebra.py", line 30, in _commonType
t = a.typecode()
AttributeError: 'numpy.ndarray' object has no attribute 'typecode'
>>>
*** Meldung-Ende
Ich versuchte verschiedenes:
Auf verschiedenen Rechnern mit AMD- oder Intelprozessoren
Unter Windows 2000 wie unter Windows XP
In den verschiedenen Pythonvesionen 2.3.5, 2.4.3 oder 2.5
Mit Administratorrechten im Betriebssystem oder ohne
Verschiedenen Module nicht importierend
Auf PC und Laptop
Allein ich bringe das File nicht zum Laufen.
Bei H.P. Langtangen fand ich dann eine Testroutine, mit der die Installation getestet werden kann:
*** Routine-Beginn
import numarray.testall as testall
testall.test()
*** Routine-Ende
Nach Durchführen dieses Tests erscheint in der Meldung zuletzt:
*** Meldung-Beginn
...
1 items had failures:
10 of 1210 in cache pass
***Test Failed*** 10 failures.
numarray.numtest: 2.21 ((10, 1210), (10, 1210))
numarray.ieeespecial: 0.08 (0, 86)
numarray.records: 0.14 (0, 48)
numarray.strings: 0.25 (0, 189)
numarray.memmap: 0.27 (0, 82)
numarray.objects: 0.43 (0, 105)
numarray.memorytest: 0.03 (0, 16)
numarray.examples.convolve: 0.14 ((0, 20), (0, 20), (0, 20), (0, 20))
numarray.convolve: 0.07 (0, 45)
numarray.fft: 0.37 (0, 75)
numarray.linear_algebra: 0.87 ((0, 46), (0, 51))
numarray.image: 0.05 (0, 37)
numarray.nd_image: 1.56 (0, 397)
numarray.random_array: 0.10 (0, 53)
numarray.ma: 0.82 (0, 674)
numarray.matrix: 0.09 (0, 11)
numarray.array_protocol: 0.11 (0, 35)
numarray.dtype: 0.07 (0, 15)
Total time: 9.56
*** Meldung-Ende
Wie schon oben in verschiedenen Kombinationen versucht bleibt dieser Fehler bestehen.
Irgend etwas mache ich falsch und komme nicht dahinter.
Kann mir jemand weiterhelfen?
Gruß
Hannes
ich habe ein Problem mit Python, im speziellen mit den Numerik-Paketen, die in Python eingebunden werden sollen.
Mit dem Fileinhalt, er ist den Übungsunterlagen entnommen,
*** File-Begin Testfile.py
from Numeric import *
from numarray import *
from numpy import *
from LinearAlgebra import *
n=4
A=zeros(n*n,float);A.shape=(n,n)
b=zeros(n,float);x=zeros(n,float)
for i in range(n):
x=i/2.0
for j in range(n):
A[i,j]=2.0+float(i+1)/float(j+i+1)
b=matrixmultiply(A,x)
y=solve_linear_equations(A,b)
if abs(sum(x-y)) < 1.0E-10:
print "correct solution"
*** File-Ende Testfile.py
erhalte ich:
*** Meldung-Beginn
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
****************************************************************
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
****************************************************************
IDLE 1.1.3 >>> ================================ RESTART ================================
>>>
Traceback (most recent call last):
File "E:\TU Wien\ILFB_Seminar\2006\Testfile.py", line 18, in -toplevel-
y=solve_linear_equations(A,b)
File "D:\Programme\Python24\Lib\site-packages\Numeric\LinearAlgebra.py", line 88, in solve_linear_equations
t =_commonType(a, b)
File "D:\Programme\Python24\Lib\site-packages\Numeric\LinearAlgebra.py", line 30, in _commonType
t = a.typecode()
AttributeError: 'numpy.ndarray' object has no attribute 'typecode'
>>>
*** Meldung-Ende
Ich versuchte verschiedenes:
Auf verschiedenen Rechnern mit AMD- oder Intelprozessoren
Unter Windows 2000 wie unter Windows XP
In den verschiedenen Pythonvesionen 2.3.5, 2.4.3 oder 2.5
Mit Administratorrechten im Betriebssystem oder ohne
Verschiedenen Module nicht importierend
Auf PC und Laptop
Allein ich bringe das File nicht zum Laufen.
Bei H.P. Langtangen fand ich dann eine Testroutine, mit der die Installation getestet werden kann:
*** Routine-Beginn
import numarray.testall as testall
testall.test()
*** Routine-Ende
Nach Durchführen dieses Tests erscheint in der Meldung zuletzt:
*** Meldung-Beginn
...
1 items had failures:
10 of 1210 in cache pass
***Test Failed*** 10 failures.
numarray.numtest: 2.21 ((10, 1210), (10, 1210))
numarray.ieeespecial: 0.08 (0, 86)
numarray.records: 0.14 (0, 48)
numarray.strings: 0.25 (0, 189)
numarray.memmap: 0.27 (0, 82)
numarray.objects: 0.43 (0, 105)
numarray.memorytest: 0.03 (0, 16)
numarray.examples.convolve: 0.14 ((0, 20), (0, 20), (0, 20), (0, 20))
numarray.convolve: 0.07 (0, 45)
numarray.fft: 0.37 (0, 75)
numarray.linear_algebra: 0.87 ((0, 46), (0, 51))
numarray.image: 0.05 (0, 37)
numarray.nd_image: 1.56 (0, 397)
numarray.random_array: 0.10 (0, 53)
numarray.ma: 0.82 (0, 674)
numarray.matrix: 0.09 (0, 11)
numarray.array_protocol: 0.11 (0, 35)
numarray.dtype: 0.07 (0, 15)
Total time: 9.56
*** Meldung-Ende
Wie schon oben in verschiedenen Kombinationen versucht bleibt dieser Fehler bestehen.
Irgend etwas mache ich falsch und komme nicht dahinter.
Kann mir jemand weiterhelfen?
Gruß
Hannes