llvmlite: OSError: Could not load shared object file: llvmlite.dll

Hi, I encountered a strange problem when using numba. It looks like that numba fails to run with llvmlite.dll missing.

However, I have validated that llvmlite.dll is at the location: C:\Software\Anaconda3\lib\site-packages\llvmlite\binding, and import llvmlite does not report any error.

I will appreciate it very much if anyone could help me solve this problem : )

Package Info Python==3.8.3 numba==0.51.2 llvmlite==0.34.0

Traceback

In [1]: import numba
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-1-68d4f1bcefa7> in <module>
----> 1 import numba

C:\Software\Anaconda3\lib\site-packages\numba\__init__.py in <module>
     12 del get_versions
     13
---> 14 from numba.core import config
     15 from numba.testing import _runtests as runtests
     16 from numba.core import types, errors

C:\Software\Anaconda3\lib\site-packages\numba\core\config.py in <module>
     14
     15
---> 16 import llvmlite.binding as ll
     17
     18 IS_WIN32 = sys.platform.startswith('win32')

C:\Software\Anaconda3\lib\site-packages\llvmlite\binding\__init__.py in <module>
      2 Things that rely on the LLVM library
      3 """
----> 4 from .dylib import *
      5 from .executionengine import *
      6 from .initfini import *

C:\Software\Anaconda3\lib\site-packages\llvmlite\binding\dylib.py in <module>
      1 from ctypes import c_void_p, c_char_p, c_bool, POINTER
      2
----> 3 from llvmlite.binding import ffi
      4 from llvmlite.binding.common import _encode_string
      5

C:\Software\Anaconda3\lib\site-packages\llvmlite\binding\ffi.py in <module>
    151         break
    152 else:
--> 153     raise OSError("Could not load shared object file: {}".format(_lib_name))
    154
    155

OSError: Could not load shared object file: llvmlite.dll

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 17 (6 by maintainers)

Most upvoted comments

Hi, apologies for posting in a closed issue. This issue is the top result on Google when searching for errors in the stack trace, so I would like to leave the solution that helped me:

A fresh install of MS Windows 10 does not have the C++ redistributable package that is a dependency for llvmlite and attempting importing numba without this package will produce the error in the original post. The package can be downloaded from Microsoft’s website under “Other Tools, Frameworks, and Redistributables”.

This did not fix the issue for me. Reinstalling numba and llvmlite from the conda numba channel did though.

conda install -c numba numba
conda install -c numba llvmlite

Hi, apologies for posting in a closed issue. This issue is the top result on Google when searching for errors in the stack trace, so I would like to leave the solution that helped me:

A fresh install of MS Windows 10 does not have the C++ redistributable package that is a dependency for llvmlite and attempting importing numba without this package will produce the error in the original post. The package can be downloaded from Microsoft’s website under “Other Tools, Frameworks, and Redistributables”.

I encontered the same problem today. I finally found the problem is caused by the unsolved dependency of “llvmlite.dll”. Somehow “zlib.dll” of anaconda is not properly indexed in the operating system, so windows cannot link “zlib.dll” for “llvmlite.dll”, which lead to the OSError.

My solution is to simply copy “zlib.dll” to the folder of “llvmlite.dll”. After this operation, “import llvmlite.binding” can work well, and also “import numba”.