Abaqus and Python
Abaqus and Python
(OP)
hello all,
I am using a python script in order to calculate the angle of the maximum principle stress. To do so I need the numerical library "numarray" to calculate the eigenvalues and the eigenvectors of the stress matrix. I managed to download the "numarray" library and used it sucessfully outside abaqus, in a python shell. But when i import the library from withing abaqus, the module can not be found. I made sure that the sys.path in abaqus is set to the same one in the python shell.
the command "import numarray " works with no error.
but when i issue, " from nummarray import linear_algebra" i get:
from numarray import linear_algebra
File "C:\Python24\lib\numarray\linear_algebra\__init__.py", line 1, in ?
from LinearAlgebra2 import *
File "C:\Python24\lib\numarray\linear_algebra\LinearAlgebra2.py", line 21, in ?
import numarray.numeric as num
File "C:\Python24\lib\numarray\numeric.py", line 2, in ?
import libnumeric
ImportError: DLL load failed: The specified module could not be found.
this command is working perfectly in a python shell. this is really driving me crazy.
any help?
thx in advance
I am using a python script in order to calculate the angle of the maximum principle stress. To do so I need the numerical library "numarray" to calculate the eigenvalues and the eigenvectors of the stress matrix. I managed to download the "numarray" library and used it sucessfully outside abaqus, in a python shell. But when i import the library from withing abaqus, the module can not be found. I made sure that the sys.path in abaqus is set to the same one in the python shell.
the command "import numarray " works with no error.
but when i issue, " from nummarray import linear_algebra" i get:
from numarray import linear_algebra
File "C:\Python24\lib\numarray\linear_algebra\__init__.py", line 1, in ?
from LinearAlgebra2 import *
File "C:\Python24\lib\numarray\linear_algebra\LinearAlgebra2.py", line 21, in ?
import numarray.numeric as num
File "C:\Python24\lib\numarray\numeric.py", line 2, in ?
import libnumeric
ImportError: DLL load failed: The specified module could not be found.
this command is working perfectly in a python shell. this is really driving me crazy.
any help?
thx in advance





RE: Abaqus and Python
1. Look at the version of the Python you are trying to import from... What version ABAQUS are you running? Be aware that ABAQUS V6.5 uses Python 2.0
...but more importantly...
2. In V6.5 you are limited to the python modules that are compiled into and shipped with ABAQUS python. Namely, you can not import an external python package. Note, this capability is coming with ABAQUS V6.6!! (NB V6.6 uses Python 2.3)
RE: Abaqus and Python
corus
RE: Abaqus and Python
use:
from Numeric import *
import LinearAlgebra
In general, for stress field the principal stresses are computed by default, see the description of the objects:
odb-> FieldOutput (maxPrincipal, midPrincipal and minPrincipal members) and FieldValue.
As brep said ABAQUS has its own Python installation(version 2.0 for ABAQUS 6.4 & 6.5) which (by default) does not share modules with other Python installations (like the modules typically installed in C:\Python2x). Therefore,
it is quite possible the scripts you tested under other shells not to work under ABAQUS Python shell.
The worst part is that you cannot find useful modules (e.g. scipy) compatible with this old Python 2.0 version.
brep, thanks for the information pertaining to ABAQUS v6.6! I was looking forward to having available that improvement.