Pyside 2中嵌入的Matplotlib的释放错误

2024-09-28 23:30:27 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在为matplotlib执行this示例文件,当我正常退出主窗口时遇到以下错误。在

Fatal Python error: deallocating None

我只修改了以下几行,因为我想使用PySide2而不是PyQt。在

原件:

^{pr2}$

新增:

# Make sure that we are using QT5
matplotlib.use('Qt5Agg')
matplotlib.rcParams['backend.qt5']='PySide2'
from PySide2 import QtCore, QtWidgets

这个程序在其他方面运行得很好,当我关闭它时它就会崩溃,这有点烦人。在

我的环境包括:

  • Python 3.6.4
  • PySide2 5.6.0a1
  • MatplotLib 2.2.2

有什么想法吗?在


Tags: 文件none示例makematplotlib错误errorthis