10

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?

Jon Nordby
  • 5,494
  • 1
  • 21
  • 50
Asish Nayak
  • 101
  • 1
  • 1
  • 4
  • please show us some code and not just a exception. Also tell us what you have tried already. Please read: [How do I ask a good question](https://stackoverflow.com/help/how-to-ask) – Ente Jul 11 '20 at 16:37
  • 5
    Ente I disagree, this is the entire code that throws an error, posting extra code would not elaborate on the problem. OP obviously knows their stuff, so they know that for imports the problem cant be caused further down the file. This is an excellent question and does not need any further editing – DownloadPizza Jul 12 '20 at 18:20

4 Answers4

17

You have to install numbra version 0.48 because of a bug, run

pip install numba==0.48

Librosa Issue on Github

DownloadPizza
  • 3,307
  • 1
  • 12
  • 27
2

I've got the exact error. Solved it with

pip uninstall --yes librosa
pip install librosa --force-reinstall
O Vuruşkaner
  • 141
  • 1
  • 3
0

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.

0

Your python version should be 3.8.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 08 '22 at 13:25