dlib: ImportError: libmkl_rt.so: cannot open shared object file
I have installed dlib using pip install dlib but, upon using the correlation_tracker() I am getting the following error when I’m executing my program -
Traceback (most recent call last): File "tracking.py", line 9, in <module> import dlib File "/usr/local/lib/python2.7/dist-packages/dlib/__init__.py", line 1, in <module> from .dlib import * ImportError: libmkl_rt.so: cannot open shared object file: No such file or directory
I can see that libmkl_rt.so is in the folder /opt/intel/compilers_and_libraries_2017.2.174/linux/mkl/lib/ia32_lin/libmkl_rt.so but, somehow maybe its not linked. Can anyone please help me to solve this?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 17 (3 by maintainers)
pip install mkl it works to me
Yeah! It can be solved as follows - Create a file such as
mylibs.confin/etc/ld.so.conf.d. Then just add the path to the directory in whichlibmkl_rt.sois located in your system. It will probably be located in the following 3 directories -/opt/intel/compilers_and_libraries_2017.2.174/linux/mkl/lib/ia32_lin//opt/intel/compilers_and_libraries_2017.2.174/linux/mkl/lib/intel64_lin//opt/intel/compilers_and_libraries_2017.2.174/linux/mkl/lib/intel64_lin_mic/Or maybe, you can just find it using
locate libmkl_rt.so. Then write to the file and runsudo ldconfig. This will create links to those libraries and then the OS would be able to locate them when needed.Just want to confirm that I tried pip install mkl which did not fix the issue but then
conda install mkldid fix it for me
@iakash-1326 - update your ~./bashrc with the – libmkl_rt.so , path. No need to make any changes to — cd /etc/ld.so.conf.d
I didnt make any changes within - cd /etc/ld.so.conf.d Kindly note
export LD_LIBRARY_PATHis as suggested by @davisking , in his very first answer above . My bad i should have read his instructions properly .This fixed it for me:
conda install mklThis isn’t a dlib problem.
Google “how to add to ldconfig path”
@davisking - you sir are truly a KING - many thanks my issue is resolved 😃 God Speed - dlib is installed n running.
You have to tell your OS about the MKL. So set your LD_LIBRARY_PATH or whatever equivalent environment variable your OS uses.