ImportError installing via PIP

Hi, I’m trying to install numba via pip - i’m having trouble. Am I doing something wrong?

Blockquote
$ python3.8 -m venv venv
$ source venv/bin/activate
$ pip install numba
Collecting numba
Collecting llvmlite<0.39,>=0.38.0rc1 (from numba)
Requirement already satisfied: setuptools in ./venv/lib/python3.8/site-packages (from numba)
Collecting numpy<1.22,>=1.18 (from numba)
Installing collected packages: llvmlite, numpy, numba
Successfully installed llvmlite-0.38.0 numba-0.55.1 numpy-1.21.5
$ python -c ‘import numba’
RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/venv/lib/python3.8/site-packages/numba/init.py”, line 38, in
from numba.core.decorators import (cfunc, generated_jit, jit, njit, stencil,
File “/tmp/venv/lib/python3.8/site-packages/numba/core/decorators.py”, line 12, in
from numba.stencils.stencil import stencil
File “/tmp/venv/lib/python3.8/site-packages/numba/stencils/stencil.py”, line 11, in
from numba.core import types, typing, utils, ir, config, ir_utils, registry
File “/tmp/venv/lib/python3.8/site-packages/numba/core/ir_utils.py”, line 16, in
from numba.core.extending import _Intrinsic
File “/tmp/venv/lib/python3.8/site-packages/numba/core/extending.py”, line 19, in
from numba.core.pythonapi import box, unbox, reflect, NativeValue # noqa: F401
File “/tmp/venv/lib/python3.8/site-packages/numba/core/pythonapi.py”, line 12, in
from numba import _helperlib
ImportError: numpy.core.multiarray failed to import

It looks like Numba has a problem importing NumPy - what does:

python -c "import numpy; print(numpy.__version__)"

give?

Which platform is this?

This usually means that our wheels were compiled against the wrong version of Numpy. We have seen this type of error before at:

This probably ought to transition onto the issue tracker.

@strocode can you open a new issue on our tracker referencing this one?