简体   繁体   English

在Mavericks上安装PyQt5

[英]Install PyQt5 on Mavericks

I'm trying to install PyQt5 on my Mavericks machine. 我正在尝试在我的小牛机器上安装PyQt5。

I have tried to do it like in this link here Installing PyQt5 with Python 3 On OS X 我试着这样做就像在这里链接一样在OS X上安装PyQt5和Python 3

When I try to install qt5 with brew, there comes a warning: 当我尝试用brew安装qt5时,会出现一个警告:

qt5-5.2.1 already installed

But then when I type python configure.py 但是当我键入python configure.py

Terminal says: 终端说:

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.

Can anyone please help me with this? 有人可以帮我这个吗?

When you installed Qt via homebrew, you should have received a warning similar to: 当您通过自制软件安装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

While this information is very helpful, what you are specifically looking for will be in a directory under /usr/local/opt/qt5/$VERSION_OF_QT/bin/ as qmake is a binary utility. 虽然这些信息非常有用,但您正在寻找的内容将位于/usr/local/opt/qt5/$VERSION_OF_QT/bin/因为qmake是一个二进制实用程序。

For me, qmake is located at /usr/local/Cellar/qt5/5.3.1/bin/qmake . 对我来说, qmake位于/usr/local/Cellar/qt5/5.3.1/bin/qmake Take this path and feed it to your --configure switch and you'll be all set! 走这条路径并将它送到你的--configure开关,你就可以了!

eg python configure.py --qmake /usr/local/Cellar/qt5/5.3.1/bin/qmake 例如python configure.py --qmake /usr/local/Cellar/qt5/5.3.1/bin/qmake

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM