在枯萎的python3或python上使用import soundfile
时,我得到了:
回溯(最近通话最近): 文件“”,第1行,位于 在第142行的“ /home/erezsh/.local/lib/python3.6/site-packages/soundfile.py”文件中 引发OSError('sndfile库未找到') OSError:找不到sndfile库
我发现this post并没有帮助,因为我使用的是soundfile
而不是pysoundfile
,并且它提供的链接已断开。
此外,here由于使用pip install SoundFile
安装,因此找不到解决方案。
我在Windows上使用Ubuntu Shell。这重要吗?
我该如何解决?
答案 0 :(得分:2)
您需要安装所需的库:
在Linux上,您需要使用发行版的软件包管理器来安装libsndfile,例如
.co-table__long { max-width: 300px; height: 150px; overflow: auto; }
。
答案 1 :(得分:2)
handras答案(从2019年开始)现在(在2020年)不起作用,因此请通过(as A.B.)安装libsndfile1
sudo apt-get install libsndfile1-dev
答案 2 :(得分:1)
如果您没有sudo特权,请尝试使用conda安装。
它对我有用,而我继续通过pip安装遇到问题。
conda install -c conda-forge librosa
以上命令将安装librosa。您也许也可以只为声音文件找到一个特定的声音。
答案 3 :(得分:1)
更新:首先需要运行apt update
,它才能正常工作。
最初接受的答案对我不起作用。
我在docker图片中
apt-get install libsndfile1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libsndfile1