- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
目标是在 Heroku 上部署音频预测 ML 模型,该模型使用 Python 中的 librosa 库。
app.py 文件使用 librosa 库从音频中提取特征。
当我尝试在 Heroku 上部署时,出现如下所示的错误。
2020-06-12T03:27:43.099874+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/librosa/core/audio.py", line 10, in <module>
2020-06-12T03:27:43.099875+00:00 app[web.1]: import soundfile as sf
2020-06-12T03:27:43.099875+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/soundfile.py", line 142, in <module>
2020-06-12T03:27:43.099876+00:00 app[web.1]: raise OSError('sndfile library not found')
2020-06-12T03:27:43.099876+00:00 app[web.1]: OSError: sndfile library not found
2020-06-12T03:27:43.101008+00:00 app[web.1]: [2020-06-12 03:27:43 +0000] [11] [INFO] Worker exiting (pid: 11)
2020-06-12T03:27:43.255623+00:00 app[web.1]: [2020-06-12 03:27:43 +0000] [4] [INFO] Shutting down: Master
2020-06-12T03:27:43.255725+00:00 app[web.1]: [2020-06-12 03:27:43 +0000] [4] [INFO] Reason: Worker failed to boot.
2020-06-12T03:27:43.333827+00:00 heroku[web.1]: Process exited with status 3
2020-06-12T03:27:43.371190+00:00 heroku[web.1]: State changed from starting to crashed
这是我用来安装依赖项的 buildpack 的快照:
Flask==1.1.1
gunicorn==19.9.0
itsdangerous==1.1.0
Jinja2==2.10.1
MarkupSafe==1.1.1
Werkzeug==0.15.5
numpy>=1.9.2
scipy>=0.15.1
scikit-learn>=0.18
matplotlib>=1.4.3
pandas>=0.19
librosa==0.7.2
aniso8601==8.0.0
audioread==2.1.5
我还创建了一个 Aptfile 来安装 libsndfile1。我已在 Heroku 上链接了一个构建包,以便从此 Aptfile 进行安装。以下是我的 Aptfile 中提到的列表:
libsndfile1
libsndfile-dev
libasound2-dev
python-dev
python-numpy
python-setuptools
这是错误图像
"Unable to locate package libsndfile1"在 Heroku 上部署时
libsndfile1
libsndfile-dev
ffmpeg
以下是 Aptfile 的内容:
aniso8601==8.0.0
audioread==2.1.8
certifi==2019.11.28
cffi==1.14.0
Click==7.0
decorator==4.4.2
ffmpeg-python==0.2.0
Flask==1.1.1
Flask-RESTful==0.3.8
future==0.18.2
gunicorn==20.0.4
itsdangerous==1.1.0
Jinja2==2.11.1
joblib==0.14.1
librosa==0.7.2
llvmlite==0.31.0
MarkupSafe==1.1.1
marshmallow==3.2.2
numba==0.48.0
numpy==1.18.1
pycparser==2.20
pydub==0.23.1
pytz==2019.3
resampy==0.2.2
scikit-learn==0.22.2.post1
scipy==1.4.1
six==1.14.0
SoundFile==0.10.3.post1
Werkzeug==1.0.0
wincertstore==0.2
pandas==1.0.1
pathlib==1.0.1
最佳答案
您需要安装 sndfile
作为操作系统中的一个包。 This answer文档如何在 Heroku 上做到这一点。
关于python - 在 Heroku 上部署音频预测模型时出现 "OSError: sndfile library not found"和 "Unable to locate package libsndfile1"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62337445/
我正在尝试在 Ubuntu 上运行 Python3,但遇到了一些奇怪的错误。该脚本显然无法找到我已确认存在的文件。 这是错误 Traceback (most recent call last):
我将大量文件写入一个文件夹,没有子目录,但是在写入 280 万个文件后,出现此错误: with open(bottleneck_path, 'w') as save_file: OSError: [E
我已经编写了自己的模块,主要处理 django 站点的文件字段。在弄乱了一些与 mod_wsgi 相关的东西之后(通过更新到 3.3 解决),我让我的代码运行。在所有必要的导入之后,在定义任何类或函数
我有以下代码: except(OSError) as (errno, strerror, filename): print "OSError [%d]: %s at %s" % (errno, str
由于某种原因,在使用 fromtimestamp 构造日期时间时,当我使用小于 -43200(-12 小时)的负数时,我得到一个“OSError [Errno22] Invalid Argument”
在声明 Theano 符号函数时,我得到一个 OSError 和回溯。有趣的是,相同的代码在不同的机器上运行。一台机器配置为使用 GPU,而另一台(有错误)仅配置为 CPU。有其他人经历过这种行为并知
我正在尝试创建一本新词典。 import os import datetime parent_dir = "E:\\" directory = "cali" now = datetime.dateti
我想像这样处理特定的 OSError 代码: try: os.scandir() except OSPermissionError as error: # Only catch er
我正在尝试在我的 Linux Ubuntu 64 位机器上安装 pycryptodomex 和 pycrypto。但是,我一直收到此错误:(提前致谢!) haomin@haomin-R110CS:~$
我有以下要测试的 python 代码: def find_or_make_logfolder(self): if not path.isdir(self.logfolder):
当我尝试将 OCRopus(基于 python 的 OCR 工具)应用于 TIFF 图像时,出现以下 python 错误: Traceback (most recent call last):
我在 Tensorflow 之上使用 Python 和 Keras 来训练我的神经网络。当我从 Ubuntu 16.04 切换到 Windows 10 时,运行以下命令时无法再保存我的模型: file
问题陈述 我正在使用 python3 并尝试 pickle 一个 IntervalTrees 字典,它的重量大约为 2 到 3 GB。这是我的控制台输出: 10:39:25 - project: IN
我一直在寻找一些对某些人来说可能相对愚蠢但对我来说非常有趣的东西! :-) 在 Python 3.3 中,输入和输出错误已与 OSError 合并,因此异常类层次结构发生了变化。内置类 OSError
如果我只是这样做: import lightgbm as lgb 我得到了 python script.py Traceback (most recent call last): File "scri
我有以下代码试图在 Linux 中启动下面的每个“命令”。如果两个命令中的任何一个因任何原因崩溃,该模块会尝试保持每个命令都运行。 #!/usr/bin/env python import subpr
我想执行以下简单的服务器代码: import socket s = socket.socket() # Create a socket object host = socket.get
我正在尝试在带有配置的 Power PC 上运行以下代码: Operating System: Red Hat Enterprise Linux Server 7.6 (Maipo) CPE OS N
当我尝试通过 django 管理界面上传媒体文件时,出现此错误: OSError: [Errno 45] Operation not supported 这是回溯的最后一行: File "/pat
使用 uwsgi 和 nginx 运行 Django 3 python 3.6 应用程序会抛出太多这些!我花了太多时间试图弄清楚,所以欢迎任何帮助。 它们绝对不是客户端断开连接。在网上查找时,我发现了
我是一名优秀的程序员,十分优秀!