Pipsqweek
Pipsqweek

Reputation: 404

from PyQt4 import QtGui ImportError: cannot import name 'QtGui'

I'm new to UI design using qt - I installed qt and the pyqt4 wrapper.

I have this simply 'hello world' type script here:

import sys

from PyQt4 import QtGui


def main():

    app = QtGui.QApplication(sys.argv)

    w = QtGui.QWidget()
    w.resize(250, 150)
    w.move(300, 300)
    w.setWindowTitle('Simple')
    w.show()

    sys.exit(app.exec_())


if __name__ == '__main__':
    main()

Yet I get this error:

C:\Python34\python.exe C:/Users/me/Desktop/python/testqt.py Traceback (most recent call last): File "C:/Users/Leo/Desktop/python/testqt.py", line 2, in from PyQt4 import QtGui ImportError: cannot import name 'QtGui'

The existing answers on SE do not seem to help. What causes this?

Upvotes: 0

Views: 1815

Answers (1)

Pipsqweek
Pipsqweek

Reputation: 404

In my case I installed the PyQt4-4.11.4-gpl-Py3.4-Qt4.8.7-x32.exe and it worked

-- previously I had installed PyQt4-4.11.4-gpl-Py3.4-Qt4.8.7-x64.exe and got the error reported above.

Upvotes: 1

Related Questions