Spleeter: [Discussion] Remove Error ModuleNotFoundError: No module named 'numba.decorators'

Created on 12 Jun 2020  路  10Comments  路  Source: deezer/spleeter

Hello,
I've had a problem with spleeter, installed with pip. Fortunately this was quite an easy fix. Error says :

Traceback (most recent call last):
  File "D:\Program Files\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "D:\Program Files\Python\Python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\Program Files\Python\Python37\lib\site-packages\spleeter\__main__.py", line 58, in <module>
    entrypoint()
  File "D:\Program Files\Python\Python37\lib\site-packages\spleeter\__main__.py", line 54, in entrypoint
    main(sys.argv)
  File "D:\Program Files\Python\Python37\lib\site-packages\spleeter\__main__.py", line 40, in main
    from .commands.separate import entrypoint
  File "D:\Program Files\Python\Python37\lib\site-packages\spleeter\commands\separate.py", line 15, in <module>
    from ..separator import Separator
  File "D:\Program Files\Python\Python37\lib\site-packages\spleeter\separator.py", line 23, in <module>
    from librosa.core import stft, istft
  File "D:\Program Files\Python\Python37\lib\site-packages\librosa\__init__.py", line 12, in <module>
    from . import core
  File "D:\Program Files\Python\Python37\lib\site-packages\librosa\core\__init__.py", line 125, in <module>
    from .time_frequency import *  # pylint: disable=wildcard-import
  File "D:\Program Files\Python\Python37\lib\site-packages\librosa\core\time_frequency.py", line 11, in <module>
    from ..util.exceptions import ParameterError
  File "D:\Program Files\Python\Python37\lib\site-packages\librosa\util\__init__.py", line 77, in <module>
    from .utils import *  # pylint: disable=wildcard-import
  File "D:\Program Files\Python\Python37\lib\site-packages\librosa\util\utils.py", line 15, in <module>
    from .decorators import deprecated
  File "D:\Program Files\Python\Python37\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'

So just go and modify this file : (D:\Program Files\Python)Python37\lib\site-packages\librosa\util\decorators.py and change in the import numba.decoratorsto numba.core.decoratorsbecause it changed names :)
Save and launch spleeter and voil脿.

bug pip

Most helpful comment

Fixed with:

pip install numba==0.43.0
pip install llvmlite==0.32.1

All 10 comments

I have the same exact problem. However, I'm a complete noob at this so do you mind explaining how I modify this file exactly?

Same issue here

Fixed with:

pip install numba==0.43.0
pip install llvmlite==0.32.1

@angristan yes reverting to an old numba (<=0.48.x) could work but I had only errors when installing them
@athpap Go where python 3.6.x or 3.7.x is installed, then lib, site-packages, librosa, util, and open decorators.py with notepad, notepad++, python ide or basically any text programm and change between from import,
numba.decorators to numba.core.decorators. then save and you can use spleeter.

Had this issue with a 3rd party pytorch notebook. But I see that I will have to fix my spleeter install too. python devs don't seem to know what the word downstream actually means.

Hi everyone

The dependency issue is actually in librosa a package we rely on for fast STFT/ISTFT. The quickest fix is just to downgrade your numba install with:

pip install numba<=0.48

So just go and modify this file : (D:\Program Files\Python)Python37\lib\site-packageslibrosa\utildecorators.py and change in the import numba.decorators to numba.core.decorators because it changed names :)
Save and launch

thats worked for me

We added an explicit dependency on numba 0.48 in spleeter 1.5.3. This should then fix the issue.

Hi everyone

The dependency issue is actually in librosa a package we rely on for fast STFT/ISTFT. The quickest fix is just to downgrade your numba install with:

pip install numba<=0.48

This doesn't work easily in every circumstance. A better solution would be for python developers to learn how to pin dependencies as they learned decades ago in the Java ecosystem. https://en.wikiquote.org/wiki/George_Santayana
But pragmatically, I found the decorators.py fix suggested by hashblen to be more helpful.

Fixed with:

pip install numba==0.43.0
pip install llvmlite==0.32.1

Had issues with this, but adding the --user parameter at the end worked fine

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omgwtfbbqpls picture omgwtfbbqpls  路  3Comments

JohnSmith2007 picture JohnSmith2007  路  4Comments

JeffreyCA picture JeffreyCA  路  5Comments

rcgale picture rcgale  路  4Comments

sullivanstrong picture sullivanstrong  路  4Comments