在许多问题之后,我在 Linux Mint 18 Mate x64 上安装了 Librosa ( https://github.com/librosa/librosa )。当我想运行示例脚本时,例如:http://librosa.github.io/librosa/generated/librosa.feature.tempogram.html#librosa.feature.tempogram,它会因“Segmentation Fault”错误而崩溃:
$ python librosa-feature-tempogram-1.py
/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5.py:140: Warning: g_main_context_push_thread_default: assertion 'acquired_context' failed
qApp = QtWidgets.QApplication([str(" ")])
Segmentation fault
我试图逐行调试它,结果如下:
$ python
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import librosa
>>> # Visualize an STFT power spectrum
...
>>> import matplotlib.pyplot as plt
>>> y, sr = librosa.load(librosa.util.example_audio_file())
>>> plt.figure(figsize=(12, 8))
/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5.py:140: Warning: g_main_context_push_thread_default: assertion 'acquired_context' failed
qApp = QtWidgets.QApplication([str(" ")])
Segmentation fault
matplotlib 库和 Qt (5.7.0) 可能存在一些问题。此外,我记得我在安装 Librosa 时遇到了很多问题,包括 matplotlib,所以可能是一些安装问题。但是,我不知道如何解决它。我希望有人能为我提供有用的线索。