PyQt4 on Mavericks with python 3

2020-02-26 13:25发布

问题:

I have made a python application in Xubuntu that I am currently trying to run on Mavericks. The project uses PyQt4 for it's GUI portion. I am currently trying to install PyQt4 on Mavericks and get the following error when I run brew install pyqt:

Error: Qt currently requires --HEAD on Mavericks

I have looked around for a solution to this or what this evens means. I have never seen this error before. So my next option was to try and install manually instead. I downloaded the project, went to the directory, and ran sudo python3 configure.py but this does not install either and I get this error:

Error: Make sure you have a working Qt qmake on your PATH or use the -q
argument to explicitly specify a working Qt qmake.

Is there a way to get PyQt on Mavericks to run properly so I can run my application?

回答1:

After a lot of blood, sweat and tears I have put together a full complete list of installing pyqt on mavericks using python 3:

brew install python3
brew install qt
brew install sip --with-python3
brew install pyqt --with-python3

Add this to your .bash_profile:

PYTHONPATH=/usr/local/lib/python3.3/site-packages:$PYTHONPATH

Restart your computer.