Install old version PyQt4 on a mac by compiling the source
info at felibunda.eu
Sun Aug 8 15:54:32 BST 2021
> On 6. Aug 2021, at 14:36, Giuseppe Corbelli <corbelligiuseppe at mesdan.it> wrote:
> On 8/6/21 12:19 PM, Felix Voigt wrote:
>> Dear all,
>> I have come one step further. As a workaround I have set a symbolic link:
>> ln -s ../Cellar/qt at 4/4.8.7_6/include/QtCore Q/usr/local/include/QtCore
>> Now the output after
>> ~/.pyenv/versions/2.7.18/bin/python2.7 configure.py --qmake /usr/local/Cellar/qt at 4/4.8.7_6/bin/qmake --sip=/Users/felixvoigt/.pyenv/versions/2.7.17/bin/sip —verbose
>> Determining the layout of your Qt installation...
>> /usr/local/Cellar/qt at 4/4.8.7_6/bin/qmake -spec macx-llvm -o qtdirs.mk qtdirs.pro
>> make -f qtdirs.mk
>> llvm-g++ -c -pipe -O2 -arch x86_64 -Wall -W -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED -I/usr/local/etc/qt4/mkspecs/macx-llvm -I. -I/usr/local/Cellar/qt at 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]
>> In file included from qtdirs.cpp:1:
>> In file included from /usr/local/Cellar/qt at 4/4.8.7_6/lib/QtCore.framework/Versions/4/Headers/QCoreApplication:1:
>> In file included from /usr/local/Cellar/qt at 4/4.8.7_6/lib/QtCore.framework/Versions/4/Headers/qcoreapplication.h:45:
>> In file included from /usr/local/include/QtCore/qobject.h:47:
>> In file included from /usr/local/include/QtCore/qobjectdefs.h:45:
>> In file included from /usr/local/include/QtCore/qnamespace.h:45:
>> /usr/local/include/QtCore/qglobal.h:68:10: fatal error: 'algorithm' file not found
>> #include <algorithm>
>> 1 warning and 1 error generated.
>> make: *** [qtdirs.o] Error 1
>> Error: Failed to determine the layout of your Qt installation. Try again using
>> the --verbose flag to see more detail about the problem.
> Well, I must admit that I have no macos experience and did not follow the thread but, naively, this looks like the std C++ library headers are not installed or not available in the compiler include paths.
> algorithm is part of the standard C++ library
> Giuseppe Corbelli
Thanks for the input!
The header problem is solved by the following.
and editing configure.py:
qt_macx_spec = 'macx-llvm’
qt_macx_spec = 'unsupported/macx-clang-libc++’
(Helpful hints found at https://www.dazhuanlan.com/designer_jun/topics/1682372, I do not know, if both actions described above are necessary.)
~/.pyenv/versions/2.7.17/bin/python2.7 configure.py --qmake /usr/local/Cellar/qt at 4/4.8.7_6/bin/qmake --sip=/Users/felixvoigt/.pyenv/versions/2.7.17/bin/sip —verbose
"Determining the layout of your Qt installation...
/usr/local/Cellar/qt at 4/4.8.7_6/bin/qmake -spec unsupported/macx-clang-libc++ -o qtdirs.mk qtdirs.pro
make -f qtdirs.mk
clang++ -c -pipe -stdlib=libc++ -mmacosx-version-min=10.7 -O2 -arch x86_64 -Wall -W -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED -I/usr/local/etc/qt4/mkspecs/unsupported/macx-clang-libc++ -I. -I/usr/local/Cellar/qt at 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
clang++ -headerpad_max_install_names -stdlib=libc++ -mmacosx-version-min=10.7 -arch x86_64 -o qtdirs.app/Contents/MacOS/qtdirs qtdirs.o -F/usr/local/lib -L/usr/local/lib -framework QtCore -L/usr/local/opt/openssl at 1.0/lib -L/usr/local/Cellar/qt at 4/4.8.7_6/lib
ld: framework not found QtCore
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [qtdirs.app/Contents/MacOS/qtdirs] Error 1
Error: Failed to determine the layout of your Qt installation. Try again using
the --verbose flag to see more detail about the problem.
As far as I see, clang is now used and the libc++ headers are found. But QtCore is not found.
I tried to include the path to QtCore by adding in the ~/.bash_profile “export PATH=…:$PATH” statements, without success. There must be another way to give the right path to QtCore to the right actor.
Finally I gave up to install PyQt4,
I decided to use PyQt5 and PyQt6 and use newer code to learn it.
More information about the PyQt