英文:
AttributeError: module 'pyqtgraph.Qt.QtGui' has no attribute 'QApplication'."
问题
有关我的系统的详细信息;
Ubunttu 22.04.2 LTS x86_64
pyqtgraph v0.13.1
pyhton v3.10
我试图在第56行运行的代码;
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg
app = QtGui.QApplication([])
我收到的错误;
AttributeError: 模块 'pyqtgraph.Qt.QtGui' 没有 'QApplication' 属性。
pyqtgraph中不再支持QApplication了吗?
不确定该怎么办,我从GitHub获取了这个源代码,我并不完全理解作者当时在做什么。
编辑:
我在第58行也收到类似的错误。
win = pg.GraphicsWindow(title="plotting")
AttributeError: 模块 'pyqtgraph' 没有 'GraphicsWindow' 属性。
英文:
Details about my system;
Ubunttu 22.04.2 LTS x86_64
pyqtgraph v0.13.1
pyhton v3.10
The code I'm trying to run on line 56;
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg
app = QtGui.QApplication([])
The Error I get;
AttributeError: module 'pyqtgraph.Qt.QtGui' has no attribute 'QApplication'.
is QApplication no longer supported in pyqtgraph?
Not sure on what to do, I got this source code from github and I don't completely understand what the author was doing.
Edit:
I get a similar error on line 58.
win = pg.GraphicsWindow(title="plotting")
AttributeError: module 'pyqtgraph' has no attribute 'GraphicsWindow'.
答案1
得分: 1
我遇到了同样的问题,这是我解决的方法。
英文:
I had the same problem, this is how I resolved mine.
from PyQt5 import QtWidgets
import pyqtgraph as pg
app = QtWidgets.QApplication([])
答案2
得分: 0
GraphicsWindow
已被弃用,您应该将其替换为 GraphicsLayoutWidget
。
英文:
GraphicsWindow
has been deprecated, you should replace it with GraphicsLayoutWidget
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论