简体   繁体   中英

Librosa stops matplotlib from working

I have this simple python 3 example:

import librosa
import numpy as np
import matplotlib.pyplot as plt

# template, Fs = librosa.load('example.wav')

t = np.arange(0, 10)
plt.plot(t)
plt.show()

But as soon as I outcomment librosa.load(...) the program crashes with this error message:

/usr/lib/python3.6/site-packages/matplotlib/backends/backend_qt5.py:124: Warning: g_main_context_push_thread_default: assertion 'acquired_context' failed
  qApp = QtWidgets.QApplication([b"matplotlib"])

There is still a new window opened for the plot, but it's completely empty.

Have the exact same problem. Use scipy.io.wavfile.read(path) instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM