I don't know what the number is, but I got stuck with ʻIntel MKL Fatal ERROR: Cannot load mkl_intel_thread.dll` in Python (Anaconda / Miniconda) on Windows, and I investigated and solved it, so I summarized the best solution I think. Try.
You can find out which dll is loaded by executing where.exe mkl_intel_thread.dll
with Anaconda Prompt or Powershell.
> where.exe mkl_intel_thread.dll
C:\Miniconda3\envs\mkl_test\Library\bin\mkl_intel_thread.dll
#Note:When running in Powershell, be sure where, not where.exe !
If you see a dll that isn't installed by Anaconda or Miniconda, it definitely doesn't work with a ** version mismatch **, so either delete it or move it to another folder. (By the way, even if you manually put the latest version of MKL from Intel's site, you should delete it from the Path folder once. I got hooked here.)
If you do conda activate xxx
, the display of where.exe
will change, so if you are creating your own environment with conda, you should activate it first and then execute it.
If it doesn't work even if you delete the unnecessary dll and execute it again in step 1, it is better to create a new environment. For example, to create a new environment with Python 3.6.5: You can use any name you like for mkl_test
.
conda create -n mkl_test python=3.6.5
conda activate mkl_test
# NOTE:The first time you activate with Powershell instead of Anaconda Prompt,
# `conda init powershell`And you need to restart Powershell.
However, in this create
, if you insert anaconda at the end as usual, the default numpy and scipy will be included, so you should not include it. ** Install MKL first, and then add the libraries you need from there **.
As for the MKL version, I didn't work in 2019.4, but in 2019.1 and 2018.0.3.
conda install mkl=2019.1
From here, add the necessary libraries.
conda install numpy scipy
conda install -c pytorch pytorch=0.4.1
#etc
And finally, check the dll with where.exe mkl_intel_thread.dll
, and it is correct that only the dll under envs of the environment created this time is displayed.
> where.exe mkl_intel_thread.dll
C:\Miniconda3\envs\mkl_test\Library\bin\mkl_intel_thread.dll
If you run ʻimport numpy` etc. again in this state, it will probably work.
Recommended Posts