Install old version PyQt4 on a mac by compiling the source

Felix Voigt info at felibunda.eu
Thu Jul 8 19:37:44 BST 2021


Hello everyone, 

today I tried the same with PyQt5 with the following results. 

The configure process succeeded: 
cd ~/documents/tmp/PyQt5-5.15.4 
~/.pyenv/versions/2.7.18/bin/python2.7 configure.py --qmake /usr/local/Cellar/qt at 5/5.15.2/bin/qmake --sip=/Users/felixvoigt/.pyenv/versions/2.7.18/bin/sip --verbose 

The make process failed: 
make 
-> In file included from /Users/felixvoigt/documents/tmp/PyQt5-5.15.4/sip/QtCore/qsocketnotifier.sip:26: 

/usr/local/Cellar/qt at 5/5.15.2/lib/QtCore.framework/Headers/qsocketnotifier.h:117:35: error: constexpr function never produces a constant 
      expression [-Winvalid-constexpr] 
    Q_DECL_CONSTEXPR_NOT_WIN bool isValid() const noexcept { return *this != QSocketDescriptor(); } 
                                  ^ 

/usr/local/Cellar/qt at 5/5.15.2/lib/QtCore.framework/Headers/qsocketnotifier.h:117:75: note: undefined function 'operator!=' cannot be used 
      in a constant expression 
    Q_DECL_CONSTEXPR_NOT_WIN bool isValid() const noexcept { return *this != QSocketDescriptor(); } 
                                                                          ^ 

/usr/local/Cellar/qt at 5/5.15.2/lib/QtCore.framework/Headers/qsocketnotifier.h:124:42: note: declared here 
    friend Q_DECL_CONSTEXPR_NOT_WIN bool operator!=(QSocketDescriptor lhs, 
1 error generated. 

Any ideas how to fix it? 
Kind regards 
feli_x


> On 7. Jul 2021, at 23:20, Felix Voigt <info at felibunda.eu> wrote:
> 
> On my MacBookPro with Mojave (macOS 10.14.6) I would like to run python2.7 with the pyqt 4 or 5 module. The reason is that I have an old python program which is written for this constellation. I installed python2.7.18 via pyenv2.0.2 and want to compile pyqt4 or pyqt5 for this python version. 
> 
> First I compiled and installed sip, which worked without problems (download from https://riverbankcomputing.com/software/sip/download):
> cd ~/documents/tmp/sip-4.19.25
> ~/.pyenv/versions/2.7.18/bin/python2.7 configure.py
> make
> make install
> 
> Then I wanted to compile pyqt4 in a similar way (download from https://riverbankcomputing.com/software/pyqt/download):
> cd ~/documents/tmp/PyQt4_gpl_mac-4.12.3
> ~/.pyenv/versions/2.7.18/bin/python2.7 configure.py
> This gave me an error: /usr/local/bin/qmake failed to create a makefile.
> 
> I extended the command in several steps to:
> ~/.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.18/bin/sip --verbose
> This gave me yet another error output:
> In file included from qtdirs.cpp:1:
> In file included from /usr/local/Cellar/qt/6.1.1/lib/QtCore.framework/Versions/A/Headers/QCoreApplication:1:
> In file included from /usr/local/Cellar/qt/6.1.1/lib/QtCore.framework/Versions/A/Headers/qcoreapplication.h:43:
> /usr/local/include/QtCore/qglobal.h:45:12: fatal error: 'type_traits' file not found
> #  include <type_traits>
> 
> I removed qt (version 6.1.1) which was installed via homebrew, because I thought this might be the reason for the error. (qt4 and qt5 are still installed.) With the same command as above, this led to the new error:
> qtdirs.cpp:1:10: fatal error: 'QCoreApplication' file not found
> #include <QCoreApplication>
> 
> Does somebody have a hint for me?
> 
> Regards
> feli_x
> 
> 


More information about the PyQt mailing list