导入python声音文件库时出现问题-OSError:找不到库:“ sndfile”

时间:2019-07-01 19:24:15

标签: python linux python-3.x redhat

我正在托管一个python flask服务,该服务使用soundfile库进行音频计算。它在本地运行良好,但是当我在redhat上托管它时,我看到以下问题。任何建议-

 from soundfile import read
  File "/apollo/env/AQTAudioPoProService/lib/python3.4/site-packages/soundfile.py", line 265, in <module>
    _snd = _ffi.dlopen('sndfile')
  File "/apollo/env/AQTAudioPoProService/lib/python3.4/site-packages/cffi/api.py", line 139, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/apollo/env/AQTAudioPoProService/lib/python3.4/site-packages/cffi/api.py", line 769, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/apollo/env/AQTAudioPoProService/lib/python3.4/site-packages/cffi/api.py", line 757, in _load_backend_lib
    raise OSError("library not found: %r" % (name,))
OSError: library not found: 'sndfile'

尝试安装libsndfile

[dshanm@aqts-popro-1a-05885815] var/output/logs% sudo yum install libsndfile
Loaded plugins: priorities, security
Setting up Install Process
No package libsndfile available.
Error: Nothing to do

1 个答案:

答案 0 :(得分:0)

声音文件Python模块取决于libsndfile本机库。您需要将其安装在您的操作系统上:

$ yum install libsndfile