在Mavericks上安装PyQt5

时间:2014-05-13 09:29:34

标签: python pyqt qt5 pyqt5

我正在尝试在我的Mavericks机器上安装PyQt5。

我尝试过这样的链接Installing PyQt5 with Python 3 On OS X

当我尝试使用brew安装qt5时,会出现警告:

qt5-5.2.1 already installed

但是当我输入python configure.py

终端说:

querying qmake about your Qt installation... Error: PyQt5 requires Qt
v5.0 or later. You seem to be using v4.8.6. Use the
--qmake flag to specify the correct version of quake.

有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:10)

当你通过自制软件安装Qt时,你应该收到类似于:

的警告
This formula is keg-only, so it was not symlinked into /usr/local.

Qt 5 conflicts Qt 4 (which is currently much more widely used).

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/qt5/lib
    CPPFLAGS: -I/usr/local/opt/qt5/include

虽然这些信息非常有用,但您正在寻找的内容将位于/usr/local/opt/qt5/$VERSION_OF_QT/bin/下的目录中,因为qmake是一个二进制实用程序。

对我来说,qmake位于/usr/local/Cellar/qt5/5.3.1/bin/qmake。走这条路并将它送到你的--configure开关,你就会全力以赴!

e.g。 python configure.py --qmake /usr/local/Cellar/qt5/5.3.1/bin/qmake