gpt4 book ai didi

python - 如何在 PySide2 应用程序中嵌入 matplotlib Canvas

转载 作者:行者123 更新时间:2023-11-28 18:14:31 25 4
gpt4 key购买 nike

我正在尝试将 matplotlib Canvas 嵌入到 PySide2 应用程序中。我试过使用这个例子:https://matplotlib.org/examples/user_interfaces/embedding_in_qt5.html

该示例使用 PyQt5 运行良好。但是,如果我将第 19 行从

from PyQt5 import QtCore, QtWidgets

进入

from PySide2 import QtCore, QtWidgets

然后 Python 因消息而崩溃

Fatal Python error: deallocating None

一旦应用程序窗口关闭。有什么方法可以使用 PySide2 使其正常工作吗?

最佳答案

事实证明,这是 PySide2 中的一个错误,现在已修复(参见 https://bugreports.qt.io/browse/PYSIDE-632?gerritReviewStatus=All)。只需更新到最新版本即可解决该问题。

关于python - 如何在 PySide2 应用程序中嵌入 matplotlib Canvas ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49343679/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com