The ordinal 242 could not be located in the dynamic link library Anaconda3\Library\bin\mkl_intel_thread.dll The ordinal 242 could not be located in the dynamic link library Anaconda3\Library\bin\mkl_intel_thread.dll python python

The ordinal 242 could not be located in the dynamic link library Anaconda3\Library\bin\mkl_intel_thread.dll


The quick answer:

set CONDA_DLL_SEARCH_MODIFICATION_ENABLE=1

I set a user environment variable for this.

The official answer is here.


If you are running Python/IPython from a console, check the priority of libiomp5md.dll using where, i.e.:

where libiomp5md.dll

This may show a few absolute paths (one per line) to different libiomp5md.dll files. A healthy setup should list Anaconda's at the top (e.g. C:\ProgramData\Anaconda3\Library\bin\libiomp5md.dll), and if there are any others listed below, they can be ignored as they have lower priority.

However, if you see a different libiomp5md.dll path at the top, then this will be loaded first, and may conflict with Anaconda's DLLs. If this file is in the current directory, then either change directory to a folder without this file, or (if possible) delete or rename the conflicting DLL file. If it's in a different folder, then you may need to re-arrange your PATH variable to move Anaconda's before other paths.


This is not a proper answer, but for me (having the exact same problem) a workaround was to downgrade "anaconda" to 5.2.0 with the Anaconda Navigator. If that works for you, too, you could start upgrading individual packages to see when the error reappears. Maybe it is a bug in one of the packages, not a problem with our systems.

Edit: Here are some links to similar or related discussions:

More edit:It also helped me to find the following files in "C:\Windows\System32" and rename them (I just appended "_renamed" to the file name).

  • mkl_core.dll
  • mkl_def.dll
  • mkl_intel_thread.dll

If I understand correctly, Python will use those instead of the ones in the Anaconda folder, which can cause problems.