AttributeError: module 'PyQt5.QtGui' has no attribute 'QApplication'

1

Code:

from PyQt5 import QtGui
import sys

app = QtGui.QApplication(sys.argv)

window = QtGui.GWidget()

window.show()

Could you tell me why this error comes out, please.

AttributeError: module 'PyQt5.QtGui' has no attribute 'QApplication'
    
asked by nick 28.05.2016 в 19:31
source

1 answer

2

The API has changed in PyQt5:

from PyQt5 import QtGui, QtWidgets

# ...

app = QtWidgets.QApplication(sys.argv)
    
answered by 30.05.2016 в 09:02