Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intel MKL Error preventing me importing Scipy in Python

I am attempting to use scipy.integrate.solve_ivp, but the problem occurs with any import statement requiring scipy, including something as simple as:

import scipy

When I run this, I receive the following error:

INTEL MKL ERROR:
   dlopen(/Users/user/.conda/envs/nephron/lib/libmkl_intel_thread.dylib, 9): 
   Library not loaded: @rpath/libiomp5.dylib
   Referenced from: /Users/user/.conda/envs/nephron/lib/libmkl_intel_thread.dylib
   Reason: no suitable image found.  Did find:
    /Users/user/.conda/envs/nephron/bin/../lib/libiomp5.dylib: file too short.
Intel MKL FATAL ERROR: Cannot load libmkl_intel_thread.dylib.

I am using the Pycharm Community IDE (version 2019.2.3) with Anaconda plugin (but it happens even with I execute the script just in my terminal), and Python version 3.7.5 on a MacBook Air running macOS High Sierra 10.13.6. My package manager is conda 4.7.12. EDIT: I have scipy version 1.3.1 installed.

I have not been able to find an explanation for this error on Stack or Google after a brief search, I have tried seeing if it was missing my installation of the package, but I looked upon the search paths being used by Python within Pycharm (as tested by running python -V in the terminal in Pycharm, indeed it occurs if I run it just through my normal Terminal), and indeed scipy was installed along one of the search paths.

EDIT:

I tried creating a new environment, removing the existing one, with conda create -n nephron scipy, this did not fix the problem.

Thank you to another user for adding a relevant tag.

Same problem appears to occur with other some other intel packages, such as numpy.

like image 829
William Bell Avatar asked Sep 14 '25 05:09

William Bell


1 Answers

I had the same issue when I installed seaborn after having installed months ago scipy. Scipy installed the mkl=2019 package and the newest version of seaborn required mkl=2020.

What I did was just deleting both scipy, seaborn and mkl=2019 and then I reinstalled them from conda.

like image 131
net_programmer Avatar answered Sep 15 '25 17:09

net_programmer