在服务器上跑的时候遇到了这个问题,原因在于sever不能显示,必须要保存下来,但是如果为了,程序能够跑起来,可以添加以下代码:

RuntimeError('Invalid DISPLAY variable')

plt.switch_backend('agg') after import matplotlib.pyplot as plt

参考:
https://github.com/matplotlib/matplotlib/issues/3466/

相关文章:

  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-20
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
  • 2022-02-25
  • 2022-12-23
相关资源
相似解决方案