Import librosa gives "no module named numba.decorators", how to solve?

Viewed 10767

I installed librosa, and now im trying to import it

import librosa

This throws me this error for some reason

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Asish nayak\AppData\Local\Programs\Python\Python38-32\lib\site-packages\librosa\__init__.py", line 12, in <module>
    from . import core
  File "C:\Users\Asish nayak\AppData\Local\Programs\Python\Python38-32\lib\site-packages\librosa\core\__init__.py", line 125, in <module>
    from .time_frequency import *  # pylint: disable=wildcard-import
  File "C:\Users\Asish nayak\AppData\Local\Programs\Python\Python38-32\lib\site-packages\librosa\core\time_frequency.py", line 11, in <module>
    from ..util.exceptions import ParameterError
  File "C:\Users\Asish nayak\AppData\Local\Programs\Python\Python38-32\lib\site-packages\librosa\util\__init__.py", line 77, in <module>
    from .utils import *  # pylint: disable=wildcard-import
  File "C:\Users\Asish nayak\AppData\Local\Programs\Python\Python38-32\lib\site-packages\librosa\util\utils.py", line 15, in <module>
    from .decorators import deprecated
  File "C:\Users\Asish nayak\AppData\Local\Programs\Python\Python38-32\lib\site-packages\librosa\util\decorators.py", line 9, in <module>
    from numba.decorators import jit as optional_jit
ModuleNotFoundError: No module named 'numba.decorators'

Why am i getting this error even after installing the library?

4 Answers

You need to use any numba version before 0.8.0

However, the most recent librosa is not compatible with any numba below 0.48.

At least, that's what I've found from using it on Windows. My solution was to use google colaboratory as it didn't give me any error when importing librosa.

I've got the exact error. Solved it with

pip uninstall --yes librosa
pip install librosa --force-reinstall

Your python version should be 3.8.

Related