小编sn1*_*234的帖子

在 docker 中:OSError: ctypes.util.find_library() 未能找到名为“sndfile”的库

我在 Windows 10 Pro 计算机上使用 Docker(Linux 容器)。我创建了一个 docker 容器来运行我的 Flask 应用程序,并在 requests.txt 文件中提到了所需的库。

当我运行 docker 容器时,我收到以下消息

OSError:ctypes.util.find_library()无法找到名为“sndfile”的库。

如何在 Docker 中安装 sndfile 库?

参考链接:https://pysoundfile.readthedocs.io/en/0.9.0/ 我尝试在 Dockerfile 中使用以下命令安装 libsndfile

    ---- RUN apt-get install libsndfile1 

    Got Below message from docker build:

    Step 5/7 : RUN apt-get install libsndfile1
     ---> Running in <container>
    Reading package lists...
    Building dependency tree...
    Reading state information...
    E: Unable to locate package libsndfile1
    The command '/bin/sh -c apt-get install libsndfile1' returned a non-zero code: 100
Run Code Online (Sandbox Code Playgroud)

1.Docker版本:

    Client:
     Version: …
Run Code Online (Sandbox Code Playgroud)

libsndfile docker

5
推荐指数
1
解决办法
7280
查看次数

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

我在Windows10计算机上对Flask应用程序进行了docker化,在docker运行后出现以下错误

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

flask应用程序在我的计算机上本地运行良好。

我提到过类似的帖子:numba缓存问题:无法缓存功能/文件没有可用的定位器

我在Dockerfile中添加了应用程序的用户访问权限。

1. Dockerfile

来自python:3.7.3

RUN useradd管理员

复制。/ app

WORKDIR / app

运行pip install -r“ requirements.txt”

RUN chown -R admin:admin / app

运行chmod 755 / app

用户管理员

ENTRYPOINT [“ python”]

CMD [“ app.py”]

2. requirements.txt

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

3.错误日志:

追溯(最近一次通话最后一次):导入librosa中的文件“ app.py”,第6 行,第13行中的文件“ /usr/local/lib/python3.7/site-packages/librosa/ init .py”, 。进口核心

从“ .time_frequency import”中输入文件“ /usr/local/lib/python3.7/site-packages/librosa/core/ init .py”,行114 * pylint:disable = wildcard-import

来自..util.exceptions的文件“ /usr/local/lib/python3.7/site-packages/librosa/core/time_frequency.py”,第10行,导入ParameterError

从.matching import中输入文件“ /usr/local/lib/python3.7/site-packages/librosa/util/ init .py”,第70行*#pylint:disable = wildcard-import …

docker numba librosa

5
推荐指数
1
解决办法
288
查看次数

标签 统计

docker ×2

librosa ×1

libsndfile ×1

numba ×1