我正在尝试部署一个使用 TensorFlow 和 Librosa 的烧瓶应用程序。因此,作为 Librosa 的依赖项,我需要sndfile包。
当我运行我的 Flask 应用程序时,我收到此错误:
import librosa
File "/home/ec2-user/.local/lib/
python3.7/site-packages/librosa/__init__.py", line 211, in <module>
from . import core
File "/home/ec2-user/.local/lib/python3.7/site-packages/librosa/core/__init__.py", line 6, in <module>
from .audio import * # pylint: disable=wildcard-import
File "/home/ec2-user/.local/lib/python3.7/site-packages/librosa/core/audio.py", line 8, in <module>
import soundfile as sf
File "/home/ec2-user/.local/lib/python3.7/site-packages/soundfile.py", line 142, in <module>
raise OSError('sndfile library not found')
OSError: sndfile library not found
[ec2-user@ip-172-31-90-51 CE_Ayush_Deployment]$ python3 app.py
Traceback (most recent call last):
File "app.py", line 2, in <module>
from model_pipeline import Corona_Diagnoser
File "/home/ec2-user/CE_Ayush_Deployment/model_pipeline.py", line 5, in <module>
import librosa
File "/home/ec2-user/.local/lib/python3.7/site-packages/librosa/__init__.py", line 211, in <module>
from . import core
File "/home/ec2-user/.local/lib/python3.7/site-packages/librosa/core/__init__.py", line 6, in <module>
from .audio import * # pylint: disable=wildcard-import
File "/home/ec2-user/.local/lib/python3.7/site-packages/librosa/core/audio.py", line 8, in <module>
import soundfile as sf
File "/home/ec2-user/.local/lib/python3.7/site-packages/soundfile.py", line 142, in <module>
raise OSError('sndfile library not found')
OSError: sndfile library not found
我试过了:
sudo yum install autoconf autogen automake build-essential libasound2-dev \
libflac-dev libogg-dev libtool libvorbis-dev libopus-dev libmp3lame-dev \
libmpg123-dev pkg-config python
然后我收到这条消息:
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package build-essential available.
No package libasound2-dev available.
No package libflac-dev available.
No package libogg-dev available.
No package libvorbis-dev available.
No package libopus-dev available.
No package libmp3lame-dev available.
No package libmpg123-dev available.
No package pkg-config available.
我知道该软件包在 Amazon EC2 实例中不可用。谁能指导我如何将 sndfile 包安装到系统中?