Intel MKL FATAL ERROR: Cannot load libmkl_core.dylib

Hi! I am new and just installed pytorch via anaconda. I used the steps listed on the pytorch website and even tried reinstalling following those instructions as well. My installation of pytorch goes smoothly but when I try running the verification code, I get the error listed: Intel MKL FATAL ERROR: Cannot load libmkl_core.dylib. I am using a Mac. Whenever I have researched this topic in the past, the most similar solution I have seen is: https://github.com/JuliaPy/PyPlot.jl/issues/315 but I am still a beginner and all the comments on this site seem incredibly advanced ): thank you in advance!

It seems youre missing the intel core math libraries from what I gather. Have you already tried installing mkl in the same environment that you installed pytorch in, i.e.:
conda install mkl in your terminal.

1 Like

I just tried that and it downloaded, but whenever I restarted anaconda, the same error was given. Here’s the expanded code if it’s helpful:

Adapting from protocol version 5.1 (kernel 79056037-3763-439f-b1f0-27896a9bb6e1) to 5.3 (client).

INTEL MKL ERROR: dlopen(/Users/name/anaconda3/lib/libmkl_core.dylib, 9): image not found.

Intel MKL FATAL ERROR: Cannot load libmkl_core.dylib.

Hey Autumn! Have you tried:

conda install nomkl numpy scipy scikit-learn numexpr
conda remove mkl mkl-service

I have had similar issues myself trying to run PyTorch locally. If you can try using Google colab or Jupyter notebooks instead for experimentation. You can switch the runtime type’s hardware accelerator to CPU/GPU/TPU which (I have found) sometimes is all it takes. The cloud notebooks make setup a lot easier.

4 Likes

Thank you Cami! That worked fine for me!

that saved me, thank you :slight_smile:

I get this issue too and i fixed it. Thanks so much! @Autumn_Thompson, @Cami_Williams

It took me an hour to install and remove as per your instructions.

Unfortunately my problem still persists.

I am using Jupyter.

This link gives a detailed explanation for the problem in question from multiple aspects along with solutions.

https://docs.anaconda.com/mkl-optimizations/index.html

Enjoy!