我正在尝试构建PyQt4,因为我需要运行的程序正在使用它
虽然只需一个命令pip install PyQt5
就可以安装PyQt 5,但对于较旧的PyQt 4,这是不可能的,人们建议从源代码构建它
我已经按照建议在PyQt4 Download上安装了SIP
我还下载了PyQt4并将其解压。现在,当我运行python configure.py --verbose
时,我得到
Stanislaw@home:PyQt4_gpl_mac-4.12.3 (master)*$ python configure.py --verbose
Determining the layout of your Qt installation...
/usr/local/bin/qmake -spec macx-g++ -o qtdirs.mk qtdirs.pro
make -f qtdirs.mk
g++ -c -pipe -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Wall -W -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED -I/usr/local/etc/qt4/mkspecs/macx-g++ -I. -I/usr/local/Cellar/qt@4/4.8.7_6/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt@4/4.8.7_6/lib/QtCore.framework/Versions/4/Headers -I/usr/local/include -I. -F/usr/local/lib -o qtdirs.o qtdirs.cpp
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
...
/usr/local/lib/QtCore.framework/Headers/qglobal.h:68:10: fatal error: 'algorithm' file not found
#include <algorithm>
^~~~~~~~~~~
我没有Qt/QPoT的经验,但我猜这个旧版本的PyQT不会配置自己使用Mac OS的基于Clang的C++工具链。p>
我将继续挖掘,但我也想知道是否存在解决这个问题的简单方法
这可能不是构建PyQt4的最佳/正确方法,但我已经构建了它,现在我的程序正在运行
以下解决方案要求安装Qt。我用它
现在是PyQt部分
PyQt安装包括3个步骤:
使
python configure.py
步骤起作用 我必须在configure.py
文件中更改此项:在第二步,当运行
make
时,我得到了与之前相同的错误,但这次它来自生成的makefile。事实证明,将-mmacosx-version-min=10.5
标志中的版本增加到-mmacosx-version-min=10.10
(通过在所有生成的makefile中替换这一行)可以消除错误(我对此的解释是,MaOSKSDK的后期版本不使用GCC的旧C++标准库,而是使用他们的新CLAN C++工具链的C++库)
之后,在运行基于PyQt4的应用程序时,我点击:
找到了解决方案here:我必须使用附加标志重建SIP:
相关问题 更多 >
编程相关推荐