import mindnlp报错:OSError: cannot load library ‘libsndfile.so‘: libsndfile.so: cannot open shared obj

在启智平台AI调试环境下,安装mindnlp后,import mindnlp报错。

安装mindnlp命令:

#安装mindnlp的daily包,待正式发布后可改为直接安装mindnlp包
!pip install https://mindspore-courses.obs.cn-north-4.myhuaweicloud.com/mindnlp/mindnlp-0.4.0-py3-none-any.whl -i https://pypi.tuna.tsinghua.edu.cn/simple
# !pip install mindnlp==0.4.0
!pip install jieba -i https://pypi.tuna.tsinghua.edu.cn/simple
!pip install tiktoken -i https://pypi.tuna.tsinghua.edu.cn/simple
%env HF_ENDPOINT=https://hf-mirror.com

import mindnlp报错信息:


[WARNING] ME(106:281472992808976,MainProcess):2024-10-10-01:21:04.337.056 [mindspore/hal/device.py:155] Backend Ascend is not created yet.
[WARNING] ME(106,ffff89c01010,python):2024-10-10-01:21:04.336.789 [mindspore/ccsrc/runtime/hardware/device_context_manager.cc:466] GetDeviceContext] Device context of device Ascend is not created yet.
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
File /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/soundfile.py:161
    159     raise OSError('no packaged library for this platform')
--> 161 import _soundfile_data  # ImportError if this doesn't exist
    162 _path = _os.path.dirname(_soundfile_data.__file__)  # TypeError if __file__ is None

ModuleNotFoundError: No module named '_soundfile_data'

During handling of the above exception, another exception occurred:
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory


解决问题:

看到PaddleSpeech有个issue:https://github.com/PaddlePaddle/PaddleSpeech/issues/3044
说参考这个issue:https://github.com/PaddlePaddle/PaddleSpeech/issues/440
提示:
libsndfile.so 安装目录是在“/usr/local/lib”下面,检查一下你的“LD_LIBRARY_PATH”是否包含这个目录,如果没有就export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH,再尝试运行一下。

问题是这个系统里根本就没有libsndfile这个库,

ls /usr/local/lib发现该目录下没东西。而且启智没法用pkg安装包。

pkg search wget
sh: pkg: command not found

原来启智用的系统是EulerOS ,包管理软件是yum ,于是用yum来安装libsndfile包:

yum install libsndfile


这样报错问题解决。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值