CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Cantera Python error (https://www.cfd-online.com/Forums/main/243040-cantera-python-error.html)

kakkapriyesh May 25, 2022 13:56

Cantera Python error
 
Hi all,

I am running AMD system on UBUNTU 20.2 and I faced the following error after successfully installing Cantera via Conda

Code:

import cantera
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/priyesh/anaconda3/envs/ct-env/lib/python3.9/site-packages/cantera/__init__.py", line 4, in <module>
from ._cantera import *
ImportError: libmkl_rt.so.2: cannot open shared object file: No such file or directory

I solved this issue by going to the cantera source code and changing "libmkl_rt.so.1" to "libmkl_rt.so.2"

I hope this helps.

Mighty Boulder May 30, 2022 16:26

Where did you find the libmkl_rt.so? I have not been able to locate it...

kakkapriyesh May 31, 2022 11:47

I think you will have to find the installed dir, for me I installed it through Conda, so the installed directory was in the conda environment. The error will also throw the path at which the directory is missing, go to that path and search for "libmkl" only and not the complete thing (because the file name might have numbers at the end).

Hope this helps

pdeforfree January 30, 2023 14:23

Quote:

Originally Posted by kakkapriyesh (Post 828672)
Hi all,

I am running AMD system on UBUNTU 20.2 and I faced the following error after successfully installing Cantera via Conda

Code:

import cantera
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/priyesh/anaconda3/envs/ct-env/lib/python3.9/site-packages/cantera/__init__.py", line 4, in <module>
from ._cantera import *
ImportError: libmkl_rt.so.2: cannot open shared object file: No such file or directory

I solved this issue by going to the cantera source code and changing "libmkl_rt.so.1" to "libmkl_rt.so.2"

I hope this helps.

I had the same issue, where the error was for missing libmkl_rt.so.2 while libmkl_rt.so.1 existed in my anaconda3/envs/cantera/lib folder. Rather than editing the Cantera source code, adding a soft symbolic link did the trick: ln -s libmkl_rt.so.1 libmkl_rt.so.2.


All times are GMT -4. The time now is 16:30.