Line 3 is a test that shows a small Qt GUI (this worked). However, I could not import the module: I think it was because I have multiple versions of Python on this old system. Python was probably installed with MacPorts (or something) and also brew. Running the following fixed the problem: this will ensure that
1 2 3 brew update brew install pyqt brew test pyqt
which pythonpoints to the brew Python which is the Python being used to run
brew test pyqtwhich we know works.