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.
The root cause maybe NumPy,SciPy is unable to load the correct MKL or Intel OpenMP runtime libraries. This is almost always caused by one of two things:
The environment with NumPy or SciPy has not been activated.
Another software vendor has installed MKL or Intel OpenMP (libiomp5md.dll) files into the C:\Windows\System32 folder. These files are being loaded before Anaconda's and they're not compatible.
Try to set environment or do preload dll etc.
Here is Linux
In windows, setting env by mkl/bin/mklvars.bat intel64, then run your python in same environment
or in python to add the library manually sys.path.append(" your path to the library") or Pyinstaller numpy "Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll"...