import soundfile cannot load library ‘libsndfile.so‘已解决

问题背景

最近在研究vggish,音频处理时有用到soundfile这个模块,但是import soundfile出现以下报错

OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory

import soundfile报错解决方法

在查阅了一些资料之后,找到原因是环境中没有装好libsndfile
我的系统是centos,所以执行以下代码

yum install libsndfile1

如果是Ubuntu系统则是

apt-get install libsndfile1

如果权限不够就在前面加sudo

yum指令报错

但是我在执行yum命令的过程中又出现了以下报错

(keke) [root@VM-162-17-centos ~]# yum install libsndfile1
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                                                                                                         | 3.6 kB  00:00:00     
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.


 One of the configured repositories failed (EPEL for redhat/centos 7 - x86_64),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=epel ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable epel
        or
            subscription-manager repos --disable=epel

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=epel.skip_if_unavailable=true

failure: repodata/repomd.xml from epel: [Errno 256] No more mirrors to try.
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable

而且是yum相关的指令都出现了报错,又查了好多终于找到原因

解决办法

找到这篇https://blog.csdn.net/wy_bk/article/details/89648052
简单来说就是我现在配置的源有重复的,机器看不懂导致跑不了,删几个源的配置就可以。

yum install libsndfile1报错

No package libsndfile1 available

是的又说找不到这个包,

解决方法

好在又找到这篇https://blog.csdn.net/zhangxiaoyang0/article/details/109162240
简单来说就是现在yum安装某个包的时候要去一个池子里找,但是池子里没有我想装的libsndfile1所以安不了,解决办法是扩展包的池子(添加企业版的Linux库),含有的包比较多。

yum install epel-release

总之最后我终于装成功了,许愿下之后不要碰到环境问题了!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值