[PyQt] [Mac] PyQt5 and Qt5.1.0 beta 1 - NameError: global name 'QApplication' is not defined

Phil Thompson phil at riverbankcomputing.com
Mon May 20 22:12:54 BST 2013


On Mon, 20 May 2013 20:03:16 +0100, Chris Roebuck <chris at cjroebuck.com>
wrote:
> Using osx 10.8.3 I installed Qt5.1.0 beta1 using the binary installer,
then
> built sip 4.14.7 dev snapshot and PyQt5 against Qt5.1.0 beta1
> 
> Using python3 I'm getting the following error when I try to run this
simple
> script:
> 
> #!/usr/bin/env python
> from PyQt5.QtCore import *
> from PyQt5.QtGui import *
> from PyQt5.QtWebKit import *
> from PyQt5.QtNetwork import *
> 
> QApplication.instance()
> 
> 
> 
> NameError: name 'QApplication' is not defined
> 
> Any ideas what i'm missing?

from PyQt5.QtWidgets import QApplication

Phil


More information about the PyQt mailing list