1

i'm having some problems with librosa python module. It shows me the following warning at import.

/opt/anaconda3/envs/pox/lib/python3.6/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

since my code seems to work fine i just would like to don't show this warning anymore (i tried to fix it but i couldn't). I have tried to use warnings module like so

import librosa
import warnings
warnings.filterwarnings("ignore")

but the same warning is shown. (i'm using anaconda python's 3.6 virtual enviroment)

Giuppox
  • 1,393
  • 9
  • 35

2 Answers2

1

Try:

import warnings
from numba.errors import NumbaPerformanceWarning
warnings.filterwarnings("ignore", category=NumbaPerformanceWarning)

If the above doesn't work:

import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
Pedro Lobito
  • 94,083
  • 31
  • 258
  • 268
0

This worked perfectly for me:

import sys

if not sys.warnoptions:
    import warnings
    warnings.simplefilter("ignore")

from here

Rocket
  • 31
  • 6