gpt4 book ai didi

docker - 运行时错误 : cannot cache function '__jaccard' : no locator available for file '/usr/local/lib/python3.7/site-packages/librosa/util/matching.py'

转载 作者:行者123 更新时间:2023-12-04 16:03:50 25 4
gpt4 key购买 nike

我正在 Windows10 机器上对 Flask 应用程序进行 dockerising。在 docker 运行后出现以下错误

运行时错误:无法缓存函数“__jaccard”:没有可用于文件“/usr/local/lib/python3.7/site-packages/librosa/util/matching.py”的定位器

Flask 应用程序在我的机器上本地运行良好。

我提到了类似的帖子:numba caching issue: cannot cache function / no locator available for file

我已经在 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.需求.txt
flask
tensorflow
flask_cors
uuid
librosa
numba
pysoundfile
numpy
cffi
requests
wave
h5py
pydub
werkzeug

3. 错误日志:
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'

最佳答案

我已经通过安装旧版本解决了这个问题。

pip install librosa==0.6.0

关于docker - 运行时错误 : cannot cache function '__jaccard' : no locator available for file '/usr/local/lib/python3.7/site-packages/librosa/util/matching.py' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56995232/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com