gpt4 book ai didi

python - 操作系统错误 : cannot open shared object file: No such file or directory even though file is in the folder

转载 作者:太空宇宙 更新时间:2023-11-03 11:02:37 26 4
gpt4 key购买 nike

我已经和这个问题斗争了很长一段时间了。我正在尝试安装 Yaafe 以提取音频特征。我按照此处的说明进行操作:https://github.com/Yaafe/Yaafe

一切都安装得很好,但是当我尝试运行测试文件“frames.py”时,出现以下错误:

  File "frames.py", line 6, in <module>
from yaafelib import FeaturePlan, Engine, AudioFileProcessor
File "/usr/local/lib/python2.7/dist-packages/yaafelib/__init__.py", line 36, in <module>
from yaafelib.core import (loadComponentLibrary,
File "/usr/local/lib/python2.7/dist-packages/yaafelib/core.py", line 35, in <module>
yaafecore = cdll.LoadLibrary('libyaafe-python.so')
File "/usr/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
return self._dlltype(name)
File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError: libyaafe-python.so: cannot open shared object file: No such file or directory

我已使用以下命令将 lib 目录包含到 LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=/usr/local/lib

确实,当我回显 LIBRARY_PATH 时,它就在那里。此外,当我检查/usr/local/lib 时,它包含以下内容:

libyaafe-components.so         libyaafe-io.so             python2.7
libyaafe-components.so.0 libyaafe-io.so.0 python3.4
libyaafe-components.so.0.70.0 libyaafe-io.so.0.70.0 site_ruby
libyaafe-core.so libyaafe-python.so yaafe
libyaafe-core.so.0 libyaafe-python.so.0
libyaafe-core.so.0.70.0 libyaafe-python.so.0.70.0

所以不应该一切都好吗?我不明白这是什么问题。我已按照说明进行操作。

最佳答案

更改您的代码,以便在异常发生之前打印 os.environ。这样你就会看到 Python 进程是否设置了正确的环境。另一个需要检查的显而易见的事情是您的 Python 进程是否具有足够的权限来打开和读取 libyaafe-python.so。请注意,出于安全原因,默认情况下 sudo 会限制调用命令的环境(例如,请参阅 here)。

关于python - 操作系统错误 : cannot open shared object file: No such file or directory even though file is in the folder,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28481900/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com