Something wrong with librosa installation? ModuleNotFoundError: No module named 'numba.decorators'

2,502 views
Skip to first unread message

John Seales

unread,
Jun 24, 2020, 12:50:42 PM6/24/20
to librosa
Hi, I can't seem to get librosa to work. 

I'm on a mac, using python 3.7.3. As you can see, I do:
pip install librosa -- python -- import librosa, but it's not happy.
There's an error: ModuleNotFoundError: No module named 'numba.decorators'


johnseales@Johns-MacBook-Pro musicnn % pip install librosa

Requirement already satisfied: librosa in /Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages (0.7.2)

Requirement already satisfied: audioread>=2.0.0 in /Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages (from librosa) (2.1.8)

Requirement already satisfied: numpy>=1.15.0 in /Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages (from librosa) (1.18.5)

Requirement already satisfied: scipy>=1.0.0 in /Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages (from librosa) (1.4.1)

Requirement already satisfied: scikit-learn!=0.19.0,>=0.14.0 in /Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages (from librosa) (0.23.1)

Requirement already satisfied: joblib>=0.12 in /Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages (from librosa) (0.15.1)

Requirement already satisfied: decorator>=3.0.0 in /Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages (from librosa) (4.4.2)

Requirement already satisfied: six>=1.3 in /Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages (from librosa) (1.15.0)

Requirement already satisfied: resampy>=0.2.2 in /Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages (from librosa) (0.2.2)

Requirement already satisfied: numba>=0.43.0 in /Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages (from librosa) (0.50.0)

Requirement already satisfied: soundfile>=0.9.0 in /Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages (from librosa) (0.10.3.post1)

Requirement already satisfied: threadpoolctl>=2.0.0 in /Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages (from scikit-learn!=0.19.0,>=0.14.0->librosa) (2.1.0)

Requirement already satisfied: setuptools in /Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages (from numba>=0.43.0->librosa) (47.3.1)

Requirement already satisfied: llvmlite<0.34,>=0.33.0.dev0 in /Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages (from numba>=0.43.0->librosa) (0.33.0)

Requirement already satisfied: cffi>=1.0 in /Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages (from soundfile>=0.9.0->librosa) (1.14.0)

Requirement already satisfied: pycparser in /Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages (from cffi>=1.0->soundfile>=0.9.0->librosa) (2.20)



johnseales@Johns-MacBook-Pro musicnn % python

Python 3.7.3 (default, Nov 22 2019, 10:27:33) 

[Clang 10.0.0 (clang-1000.10.44.4)] on darwin

Type "help", "copyright", "credits" or "license" for more information.



>>> import librosa

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages/librosa/__init__.py", line 12, in <module>

    from . import core

  File "/Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages/librosa/core/__init__.py", line 125, in <module>

    from .time_frequency import *  # pylint: disable=wildcard-import

  File "/Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages/librosa/core/time_frequency.py", line 11, in <module>

    from ..util.exceptions import ParameterError

  File "/Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages/librosa/util/__init__.py", line 77, in <module>

    from .utils import *  # pylint: disable=wildcard-import

  File "/Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages/librosa/util/utils.py", line 15, in <module>

    from .decorators import deprecated

  File "/Users/johnseales/.pyenv/versions/3.7.3/lib/python3.7/site-packages/librosa/util/decorators.py", line 9, in <module>

    from numba.decorators import jit as optional_jit

ModuleNotFoundError: No module named 'numba.decorators'




Valentin Haenel

unread,
Jun 25, 2020, 2:39:07 AM6/25/20
to John Seales, librosa
Hi John,

Val here, I am one of the Numba maintainers. The exception you are seeing is due to a refactoring that happened throughout the Numba 0.49.* and 0.50.* releases. Specifically:


And


So, your best bet is to install Numba version 0.49.1 for the time being.

Best wishes and do let us know if it works for you!

V-


--
You received this message because you are subscribed to the Google Groups "librosa" group.
To unsubscribe from this group and stop receiving emails from it, send an email to librosa+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/librosa/5ac20f8e-3d85-49ca-a788-17bdb06562f0o%40googlegroups.com.

John Seales

unread,
Jun 25, 2020, 2:26:46 PM6/25/20
to librosa
Hi Valentin, 

Thanks for getting back to me with some insight into what is happening. "pip install numba==0.49.1" worked. 

Probably not news to you, but installing librosa did throw this warning:

/root/miniconda3/lib/python3.7/site-packages/librosa/util/decorators.py:9: NumbaDeprecationWarning: An import was requested from a module that has moved location.
Import requested from: 'numba.decorators', please update to use 'numba.core.decorators' or pin to Numba version 0.48.0. This alias will not be present in Numba version 0.50.0.

from numba.decorators import jit as optional_jit
/root/miniconda3/lib/python3.7/site-packages/librosa/util/decorators.py:9: NumbaDeprecationWarning: An import was requested from a module that has moved location.
Import of 'jit' requested from: 'numba.decorators', please update to use 'numba.core.decorators' or pin to Numba version 0.48.0. This alias will not be present in Numba version 0.50.0.

from numba.decorators import jit as optional_jit 

Am I understanding from this that librosa needs to catch up ?

On Wednesday, June 24, 2020 at 11:39:07 PM UTC-7, Valentin Haenel wrote:
Hi John,

Val here, I am one of the Numba maintainers. The exception you are seeing is due to a refactoring that happened throughout the Numba 0.49.* and 0.50.* releases. Specifically:


And


So, your best bet is to install Numba version 0.49.1 for the time being.

Best wishes and do let us know if it works for you!

V-


To unsubscribe from this group and stop receiving emails from it, send an email to lib...@googlegroups.com.

Valentin Haenel

unread,
Jun 26, 2020, 4:48:42 AM6/26/20
to John Seales, librosa
Hi John,

thanks for reporting back and yes those warnings are to be expected. And yes, I believe that a few imports in librosa will need to be fixed. Also, I believe that everyone with stake in this topic has been discussing it on: https://github.com/numba/numba/issues/5865 and I think it is just a matter of time until things will be sorted out.

Best wishes,

V- 

To unsubscribe from this group and stop receiving emails from it, send an email to librosa+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/librosa/ec657913-c1b9-4ef1-b118-7710253f3731o%40googlegroups.com.

Brian McFee

unread,
Jun 26, 2020, 7:59:47 AM6/26/20
to librosa
Yes, this problem has already been fixed in the development branch of librosa.

We're aiming to get 0.8 out the door in the next couple of weeks, but in the meantime, pinning the numba install to <=0.49.1 should suffice as a workaround.

John Seales

unread,
Jun 26, 2020, 3:05:26 PM6/26/20
to librosa
Thanks all! Good to know a fix is coming, and that in the meantime I can make things work.
Reply all
Reply to author
Forward
0 new messages