ImportError: cannot import name 'npdatetime_helpers' from 'numba.np' (unknown location)

Hello,
I have a trouble with importing numba.

import numba
Traceback (most recent call last):
File “”, line 1, in
File “/home01/e1348a02/.local/lib/python3.8/site-packages/numba/init.py”, line 20, in
from numba.core import types, errors
File “/home01/e1348a02/.local/lib/python3.8/site-packages/numba/core/types/init.py”, line 12, in
from .scalars import *
File “/home01/e1348a02/.local/lib/python3.8/site-packages/numba/core/types/scalars.py”, line 9, in
from numba.np import npdatetime_helpers
ImportError: cannot import name ‘npdatetime_helpers’ from ‘numba.np’ (unknown location)

Here are my pip list and conda list.

pip3 list
condPackage Version


aiohttp 3.8.1
aiohttp-cors 0.7.0
aioredis 1.3.1
aiosignal 1.2.0
async-timeout 4.0.2
attrs 21.4.0
blessed 1.19.1
cachetools 5.0.0
certifi 2022.12.7
charset-normalizer 2.0.12
click 8.1.2
colorama 0.4.4
colorful 0.5.4
cycler 0.11.0
defusedxml 0.7.1
Deprecated 1.2.13
filelock 3.6.0
fonttools 4.31.2
fortio 0.4
frozenlist 1.3.0
google-api-core 2.7.1
google-auth 2.6.2
googleapis-common-protos 1.56.0
gpustat 1.0.0b1
grpcio 1.43.0
hiredis 2.0.0
idna 3.3
importlib-metadata 6.0.0
importlib-resources 5.6.0
jsonschema 4.4.0
kiwisolver 1.4.2
lazy-property 0.0.1
llvmlite 0.39.1
matplotlib 3.5.1
mkl-fft 1.3.1
mkl-random 1.2.2
mkl-service 2.4.0
mpmath 1.2.1
msgpack 1.0.3
multidict 6.0.2
numba 0.56.4
numpy 1.21.5
nvidia-ml-py3 7.352.0
opencensus 0.8.0
opencensus-context 0.1.2
packaging 21.3
Pillow 9.1.0
pip 21.2.4
prometheus-client 0.13.1
protobuf 3.20.2
psutil 5.9.0
py-spy 0.3.11
pyasn1 0.4.8
pyasn1-modules 0.2.8
pyFFTW 0.13.0
pyfiglet 0.8.post1
pyparsing 3.0.7
pyrsistent 0.18.1
python-dateutil 2.8.2
PyYAML 6.0
ray 1.11.0
redis 4.2.2
requests 2.27.1
rsa 4.8
scipy 1.8.0
setuptools 58.0.4
six 1.16.0
smart-open 5.2.1
spglib 1.16.5
sympy 1.11.1
termcolor 1.1.0
untangle 1.2.1
urllib3 1.26.9
wannierberri 0.13.5
wcwidth 0.2.5
wheel 0.37.1
wrapt 1.14.0
yarl 1.7.2
zipp 3.11.0

conda list

packages in environment at /home01/e1348a02/.conda/envs/wb:

Name Version Build Channel

_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
aiohttp 3.8.1
aiohttp-cors 0.7.0
aioredis 1.3.1
aiosignal 1.2.0
async-timeout 4.0.2
attrs 21.4.0
blas 1.0 mkl
blessed 1.19.1
ca-certificates 2023.01.10 h06a4308_0
cachetools 5.0.0
certifi 2022.12.7 py38h06a4308_0
charset-normalizer 2.0.12
click 8.1.2
colorama 0.4.4
colorful 0.5.4
cycler 0.11.0
defusedxml 0.7.1
Deprecated 1.2.13
filelock 3.6.0
fonttools 4.31.2
fortio 0.4
frozenlist 1.3.0
google-api-core 2.7.1
google-auth 2.6.2
googleapis-common-protos 1.56.0
gpustat 1.0.0b1
grpcio 1.43.0
hiredis 2.0.0
idna 3.3
importlib-metadata 4.11.3 py38h06a4308_0
importlib-metadata 6.0.0
importlib-resources 5.6.0
importlib_metadata 4.11.3 hd3eb1b0_0
intel-openmp 2021.4.0 h06a4308_3561
jsonschema 4.4.0
kiwisolver 1.4.2
lazy-property 0.0.1
ld_impl_linux-64 2.35.1 h7274673_9
libffi 3.3 he6710b0_2
libgcc-ng 9.1.0 hdf63c60_0
libgomp 11.2.0 h1234567_1
libllvm11 11.1.0 h3826bc1_1
libstdcxx-ng 9.1.0 hdf63c60_0
llvmlite 0.39.1
llvmlite 0.39.1 py38he1b5a44_0 numba
matplotlib 3.5.1
mkl 2021.4.0 h06a4308_640
mkl-service 2.4.0 py38h7f8727e_0
mkl_fft 1.3.1 py38hd3c417c_0
mkl_random 1.2.2 py38h51133e4_0
mpmath 1.2.1
msgpack 1.0.3
multidict 6.0.2
ncurses 6.3 h7f8727e_2
numba 0.56.4 np1.11py3.8hc13618b_g288a38bbd_0 numba
numba 0.56.4
numpy 1.21.5
numpy 1.22.3 py38he7a7128_0
numpy 1.21.0
numpy-base 1.22.3 py38hf524024_0
nvidia-ml-py3 7.352.0
opencensus 0.8.0
opencensus-context 0.1.2
openssl 1.1.1t h7f8727e_0
packaging 21.3
Pillow 9.1.0
pip 21.2.4 py38h06a4308_0
prometheus-client 0.13.1
protobuf 3.20.2
psutil 5.9.0
py-spy 0.3.11
pyasn1 0.4.8
pyasn1-modules 0.2.8
pyFFTW 0.13.0
pyfiglet 0.8.post1
pyparsing 3.0.7
pyrsistent 0.18.1
python 3.8.12 h12debd9_0
python-dateutil 2.8.2
PyYAML 6.0
ray 1.11.0
readline 8.1.2 h7f8727e_1
redis 4.2.2
requests 2.27.1
rsa 4.8
scipy 1.8.0
setuptools 58.0.4 py38h06a4308_0
six 1.16.0 pyhd3eb1b0_1
smart-open 5.2.1
sqlite 3.38.2 hc218d9a_0
sympy 1.11.1
termcolor 1.1.0
tk 8.6.11 h1ccaba5_0
untangle 1.2.1
urllib3 1.26.9
wannierberri 0.13.5
wcwidth 0.2.5
wheel 0.37.1 pyhd3eb1b0_0
wrapt 1.14.0
xz 5.2.5 h7b6447c_0
yarl 1.7.2
zipp 3.8.0
zipp 3.11.0 py38h06a4308_0
zlib 1.2.12 h7f8727e_2

Thank you.

It looks like your conda environment is messed up and you have multiple versions of Numba installed (a release version and something built from source?) - I’d suggest creating a new conda environment and re-installing Numba.