![尝试在 python3 中导入 librosa 时出错:符号 _ZTINSt8ios_base7failureB5cxx11E,版本 GLIBCXX_3.4.21 未在文件 libstdc++.so.6 中定义](https://linux22.com/image/1158914/%E5%B0%9D%E8%AF%95%E5%9C%A8%20python3%20%E4%B8%AD%E5%AF%BC%E5%85%A5%20librosa%20%E6%97%B6%E5%87%BA%E9%94%99%EF%BC%9A%E7%AC%A6%E5%8F%B7%20_ZTINSt8ios_base7failureB5cxx11E%EF%BC%8C%E7%89%88%E6%9C%AC%20GLIBCXX_3.4.21%20%E6%9C%AA%E5%9C%A8%E6%96%87%E4%BB%B6%20libstdc%2B%2B.so.6%20%E4%B8%AD%E5%AE%9A%E4%B9%89.png)
我花了一整天时间寻找这个问题的解决方案。起初这是一个 GLIBCXX_1.9 问题,我尝试使用这里的解决方案(安装 gcc 最新版本和其他解决方案),但它变成了 GLIBCXX_1.8 问题,尝试了其他解决方案,现在是这样的:
>>> import librosa
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/data-hunter/anaconda3/lib/python3.6/site-packages/librosa/__init__.py", line 14, in <module>
from . import decompose
File "/home/data-hunter/anaconda3/lib/python3.6/site-packages/librosa/decompose.py", line 23, in <module>
from . import segment
File "/home/data-hunter/anaconda3/lib/python3.6/site-packages/librosa/segment.py", line 33, in <module>
import sklearn.cluster
File "/home/data-hunter/anaconda3/lib/python3.6/site-packages/sklearn/cluster/__init__.py", line 10, in <module>
from .hierarchical import (ward_tree, AgglomerativeClustering, linkage_tree,
File "/home/data-hunter/anaconda3/lib/python3.6/site-packages/sklearn/cluster/hierarchical.py", line 23, in <module>
from . import _hierarchical
File "sklearn/utils/fast_dict.pxd", line 20, in init sklearn.cluster._hierarchical
ImportError: /home/data-hunter/anaconda3/lib/python3.6/site-packages/sklearn/utils/fast_dict.cpython-36m-x86_64-linux-gnu.so: symbol _ZTINSt8ios_base7failureB5cxx11E, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference
我已经通过 pip install 安装了 librosa,它是 v0.6.1。我的 gcc 和 g++ 是版本 4.8