22

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?

Community
  • 1
  • 1
John
  • 323
  • 2
  • 4
  • 11
  • 1
    The conda team has addressed this problem in [this GitHub issue](https://github.com/ContinuumIO/anaconda-issues/issues/10213). There is also a [new page in the conda docs](https://conda.io/projects/conda/en/latest/user-guide/troubleshooting.html#numpy-mkl-library-load-failed) about the issue. – John Mar 12 '19 at 07:57

8 Answers8

13

The quick answer:

set CONDA_DLL_SEARCH_MODIFICATION_ENABLE=1

I set a user environment variable for this.

The official answer is here.

Paul Williams
  • 3,099
  • 38
  • 34
  • The problem is stated in the linked page: "Another software vendor has installed MKL or Intel OpenMP (libiomp5md.dll) files into the C:\Windows\System32 folder". – r4w8173 May 05 '20 at 11:12
8

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.

Mike T
  • 41,085
  • 18
  • 152
  • 203
  • 1
    Such a shame I can only upvote once - thank you for this answer! I've been trying to fix this bug for hours and nothing seemed to be working.. your description really helped me:-) – LeroyFromBerlin May 07 '20 at 09:40
  • Renaming libiomp5md.dll in System32 solved the problem – Abbas Sep 15 '20 at 16:49
6

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.

Azrael_DD
  • 171
  • 9
  • I also had exactly the same problem, and the "downgrade" using Anaconda Navigator worked for me. – Doug Jenkins Dec 23 '18 at 02:05
  • 2
    This worked for me, too; downgrading from a 2018 version to 5.2.0. It was not obvious to find the downgrade option but it was there, and it took a while for the downgrade to run; all after I just had installed Anaconda to open a notebook I wanted to look at, frustrating! – Marc Stober Jan 25 '19 at 21:12
  • @MarcStober how did you downgrade? – Andi Anderle Feb 23 '19 at 20:13
  • To downgrade from Anaconda Navigator: 1. Environments (menu to the left) 2. Select "anaconda" (I think it doesn't require right-click) and select "install a different version" or something similar 3. choose the version 4. it will search every dependencies and tell how many packages will it require to reinstall. – Raúl Moreno Mar 24 '19 at 02:32
5
['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..

Mike T
  • 41,085
  • 18
  • 152
  • 203
Tirth Shah
  • 51
  • 1
  • 2
  • Why should I delete files when they are there? So some other program might need it when its there?! – Andi Anderle Feb 23 '19 at 23:31
  • Source: https://conda.io/projects/conda/en/latest/user-guide/troubleshooting.html#numpy-mkl-library-load-failed This 2 softwares may have installed (and use) those mkl: Amplitube, by IK Multimedia ASIO4ALL, by Michael Tippach I don't know if they would keep working. – Raúl Moreno Mar 24 '19 at 02:29
  • 1
    Worked! Saved the files in another directory, in case different programs need them. – mathematics-and-caffeine May 27 '20 at 10:47
  • Worked for me.thanks! i also saved the files in another directory if i needed someday. – Barzan Saeedpour Jul 22 '20 at 22:06
3

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.

Steve
  • 79
  • 2
3

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.

gabyCodes
  • 31
  • 1
2

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
Orozco
  • 375
  • 2
  • 8
1

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

Lucho
  • 221
  • 1
  • 6