Kratos Multiphysics Forums
Kratos installation/compilation issues => Compilation => Topic started by: Nelson on March 03, 2016, 07:37:47 PM
-
Hi guys,
I have compiled KRATOS using intel compiler and python 3.4 in Ubuntu 14.04 system.
Compilation was successfully done however i have this mistake when i run the example:
Traceback (most recent call last):
File "cantilever2dstatic.py", line 37, in <module>
from KratosMultiphysics import *
File "/home/nelson/Kratos_Oficial/KratosMultiphysics/__init__.py", line 13, in <module>
from Kratos import *
ImportError: dynamic module does not define init function (initKratos)
In my ./basrc i type the following things
export PYTHONPATH=/home/nelson/Kratos_Oficial/libs:$PYTHONPATH
export PYTHONPATH=/home/nelson/Kratos_Oficial:$PYTHONPATH
export PATH=/home/nelson/Kratos_Oficial:$PATH
I am wondering where is my mistake.
Regards
Nelson
-
Maybe you forgot to set LD_LIBRARY_PATH. Take a look at: http://kratos-wiki.cimne.upc.edu/index.php/LinuxInstall#Setting_up_your_enviroment
-
Hi Nelson
this is the typical error you get by mixing somehow python2 and python3
just to be sure ... are u running your example as:
python3 scriptname.py ?
(notice the 3)
cheers
Riccardo
-
Nelson,
could you run Kratos finally? Did you check the solutions proposed in this thread? If not, send more details about what you tried, your Python version(s) and copy/paste the output from terminal when you try to run...
Greetings,
Miguel Angel
-
Hi all,
I recently downloaded the latest version of Kratos and I managed to successfully compile it using boost 1.61 (compiled with python 2.7) on openSUSE 13.1. However, when I try to run a python script, I obtain the following error:
"ImportError: No module named KratosMultiphysics"
I am wondering what could be the problem.
Thanks!
Alex
-
Hi Alex,
Did you set correctly the value for the variables PYTHONPATH and LD_LIBRARY_PATH in the file .bashrc ?
Regards,
MA
-
Hi Miguel Angel,
yes, that was it! Apparently, OpenSUSE wrote something else rather than "export PYTHONPATH=/path/to/my/kratos/installation:$PYTHONPATH".
Thank you!!
Regards
-
I just had the same error as Nelson on a cluster. It was solved following Riccardo's advice. Kratos was compiled with Python 3, so in the terminal python3 must be called instead of python.
So in the case that we get import errors, they can be solved by:
a) calling python3 instead of python
b) making sure that the environment is correctly set (LD_LIBRARY_PATH, PYTHONPATH)