سؤال

Anyone know how to get it working? Unfortunately it seems by default specgram's code wants to generate an image, which I have no use for, only the data behind the image. The error I get is:

_tkinter.TclError: no display name and no $DISPLAY environment variable
هل كانت مفيدة؟

المحلول

You may set a matplotlib backend, which doesn't need a display attached:

import matplotlib
matplotlib.use('pdf')

These lines should go before importing pylab.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top