pythonpython-3.xllvmnumballvmlite

ImportError: No module named 'llvmlite.llvmpy.ee'


I need to use Numba on a cluster running on Centos 7.

However, the IT team could not install llvm 4.0 (no builder for Centos 7), so they installed llvm 3.9.

After, I successfully installed llvmlite 0.16.0 and Numba 0.17 using pip.

Unfortunately, when I start a simple test program, I get the following error: ImportError: No module named 'llvmlite.llvmpy.ee'

Here is the complete error:

Traceback (most recent call last):

File "LINCS_Test.py", line 17, in

import KerasImageDataGenerator as kidg

File "../KerasImageDataGenerator.py", line 1, in

import KerasBatchTransformation2D as bt

File "../KerasBatchTransformation2D.py", line 1, in

import numba

File

"/home/exacloud/lustre1/gray_lab/users/Guillaume/Python/lib/python3.4/site-

packages/numba/init.py", line 6, in

from . import testing, decorators

File

"/home/exacloud/lustre1/gray_lab/users/Guillaume/Python/lib/python3.4/site-

packages/numba/decorators.py", line 7, in

from .targets import registry

File

"/home/exacloud/lustre1/gray_lab/users/Guillaume/Python/lib/python3.4/site-

packages/numba/targets/registry.py", line 3, in

from . import cpu

File "/home/exacloud/lustre1/gray_lab/users/Guillaume/Python/lib/python3.4/site- packages/numba/targets/cpu.py", line 6, in

import llvmlite.llvmpy.ee as le

ImportError: No module named 'llvmlite.llvmpy.ee'

Any idea how to fix it?


Solution

  • The llvmlite repository contains a table of compatible LLVM versions. Currently it reads:

    llvmlite versions   compatible LLVM versions
    0.17.0 - ...        4.0.x
    0.16.0 - 0.17.0     3.9.x
    0.13.0 - 0.15.0     3.8.x
    0.9.0 - 0.12.1      3.7.x
    0.6.0 - 0.8.0       3.6.x
    0.1.0 - 0.5.1       3.5.x
    

    And the numba repository maintains a file listing the requirements for llvmlite: requirements.txt. Currently the requirement is:

    llvmlite>=0.20
    

    However it seems like Numba 0.33 had a requirement compatible with LLVM 3.9.x:

    llvmlite>=0.16
    

    So you probably need to use Numba 0.33.x if you want to work with LLVM 3.9. Given that numba is/was rapidly changing it seems likely that any version before numba 0.30 (first one to require llvmlite 0.16) or after 0.33 (last one to accepting llvmlite 0.16) won't work because the API changed.