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

Viewed 30703

I have just installed Anaconda 5.3 64-bit (Anaconda3-5.3.0-Windows-x86_64) on Windows 10 and am getting this error when trying to run Spyder.

pythonw.exe - Ordinal Not Found

The ordinal could not be located in the dynamic link library C:\Users\username\Anaconda3\Library\bin\mkl_intel_thread.dll.

I used Dependency Walker to view the functions in the DLL and see that ordinal 242 is there. The function associated with ordinal 242 is mkl_blas_zherk.

Could anyone help me fix this or direct me to a resource to help me figure it out myself?

8 Answers

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.

['System32\libiomp5md.dll', 'System32\mkl_core.dll', 
'System32\mkl_def.dll','System32\mkl_intel_thread.dll',
'SysWOW64\libiomp5md.dll','SysWOW64\mkl_core.dll','SysWOW64\mkl_intel_thread.dll', 
'SysWOW64\mkl_p4.dll', 'SysWOW64\mkl_p4m.dll','SysWOW64\mkl_p4m3.dll', 
'SysWOW64\mkl_p4p.dll']

Remove all these dll files from C:\Windows\SysWOW64 and C:\Windows\System32

Just do this and restart the spyder once again and hurrrahhhh!!! ur problem will be solved and spyder will open without showing any ordinal 242 error............just do it it is the only solution..

What fixed this issue for me was to uninstall Amplitube and ActiveState Python. I was receiving this exception while using Anaconda prompt and some NLP packages.

I had the same problem and after trying many solutions, including the above, I finally managed to solve it.

First, open command prompt(Administrator) and input:

set CONDA_DLL_SEARCH_MODIFICATION_ENABLE=1

Then, launch the Spyder IDE, always using the command prompt by simply inputting:

spyder

It is important to always launch spyder with the command prompt. If you launch Spyder with the Anaconda Navigator, it will still give you the error message.

Following @Azrael_DD's solution to downgrade to anaconda v5.2.0, you can also do it through a normal console:

conda install anaconda=5.2.0

Another way which Works for me (I deleted all DLL files but the problem continued) was to downgrade ANACONDA to Anaconda3-5.2.0-Windows-x86_64. I got the installer in this link

Related