Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RuntimeError: cannot cache function '__jaccard': no locator available for file '/usr/local/lib/python3.7/site-packages/librosa/util/matching.py'

I am dockerising the flask application on windows10 machine.I get the below error after the docker run

RuntimeError: cannot cache function '__jaccard': no locator available for file '/usr/local/lib/python3.7/site-packages/librosa/util/matching.py'

The flask application runs fine locally on my machine.

i referred to kind of similar post: numba caching issue: cannot cache function / no locator available for file

i have added the user access permissions for the application in the Dockerfile.

1. Dockerfile

FROM python:3.7.3

RUN useradd admin

COPY . /app 

WORKDIR /app

RUN pip install -r "requirements.txt"

RUN chown -R admin:admin /app

RUN chmod 755 /app

USER admin

ENTRYPOINT ["python"]

CMD ["app.py"] 

2. requirements.txt

flask
tensorflow
flask_cors
uuid
librosa
numba
pysoundfile
numpy
cffi
requests
wave
h5py
pydub
werkzeug

3. Error log:

Traceback (most recent call last):
  File "app.py", line 6, in <module>
    import librosa
  File "/usr/local/lib/python3.7/site-packages/librosa/__init__.py", line 13, in <module>
    from . import core


  File "/usr/local/lib/python3.7/site-packages/librosa/core/__init__.py", line 114, in <module>
    from .time_frequency import *  # pylint: disable=wildcard-import


  File "/usr/local/lib/python3.7/site-packages/librosa/core/time_frequency.py", line 10, in <module>
    from ..util.exceptions import ParameterError


  File "/usr/local/lib/python3.7/site-packages/librosa/util/__init__.py", line 70, in <module>
    from .matching import *  # pylint: disable=wildcard-import


  File "/usr/local/lib/python3.7/site-packages/librosa/util/matching.py", line 16, in <module>
    @numba.jit(nopython=True, cache=True)
  File "/usr/local/lib/python3.7/site-packages/numba/decorators.py", line 179, in wrapper
    disp.enable_caching()


  File "/usr/local/lib/python3.7/site-packages/numba/dispatcher.py", line 571, in enable_caching
    self._cache = FunctionCache(self.py_func)

  File "/usr/local/lib/python3.7/site-packages/numba/caching.py", line 614, in __init__
    self._impl = self._impl_class(py_func)

  File "/usr/local/lib/python3.7/site-packages/numba/caching.py", line 349, in __init__
    "for file %r" % (qualname, source_path))


RuntimeError: cannot cache function '__jaccard': no locator available for file '/usr/local/lib/python3.7/site-packages/librosa/util/matching.py'
like image 727
sn1234 Avatar asked Jul 11 '19 18:07

sn1234


1 Answers

I've solved the problem by installing old version.

pip install librosa==0.6.0
like image 69
Donghyun Kwak Avatar answered Nov 15 '22 05:11

Donghyun Kwak