Bug report #17218

OS X install looks for PyQt4 instead of PyQt5

Added by David Liontooth about 7 years ago. Updated over 5 years ago.

Status:Feedback
Priority:Normal
Assignee:dmartella -
Category:Build/Install
Affected QGIS version:master Regression?:No
Operating System:OS X 10.12.6 Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:25117

Description

On an up-to-date OS X Sierra, using QGIS git master and MacPorts' QT5 following David Marteau's instructions at https://www.3liz.com/blog/rldhont/index.php?post/2017/06/01/How-to-build-qgis-on-OSX-with-MacPort), I set the compilers as suggested in INSTALL:

export CC=/usr/bin/llvm-gcc
export CXX=/usr/bin/llvm-g++

The build was successful, but install complains. I take it these codecs are not required?

-- Updating QGIS library paths...
-- Copying Qt frameworks...
ditto: can't get real path for source '/opt/local/libexec/qt5/plugins/codecs/libqcncodecs.dylib'
ditto: can't get real path for source '/opt/local/libexec/qt5/plugins/codecs/libqjpcodecs.dylib'
ditto: can't get real path for source '/opt/local/libexec/qt5/plugins/codecs/libqkrcodecs.dylib'
ditto: can't get real path for source '/opt/local/libexec/qt5/plugins/codecs/libqtwcodecs.dylib'
ditto: can't get real path for source '/opt/local/libexec/qt5/plugins/phonon_backend/libphonon_qt7.dylib'

Install finds QT5, but looks for PyQt4 instead of PyQt5 -- py36-pyqt5 @5.8.2_0 is installed:

-- Copying Qwt and updating library paths...
-- Copying QCA and updating library paths...
-- Found QCA plugin directory: /opt/local/libexec/qt5/plugins
-- Updating QCA plugins with QCA library path in /opt/local/libexec/qt5/plugins ...
-- PYTHON_MODULE_PATHS to be searched:
--   /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
--   /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
-- Copying sip...
-- Copying PyQt...
--   PyQt4 module Qt.so not found
--   PyQt4 module QtCore.so not found
--   PyQt4 module QtGui.so not found
--   PyQt4 module phonon.so not found
--   PyQt4 module QtXml.so not found
--   PyQt4 module QtNetwork.so not found
--   PyQt4 module QtScript.so not found
--   PyQt4 module QtSvg.so not found
--   PyQt4 module QtSql.so not found
--   PyQt4 module QtWebKit.so not found
--   PyQt4 module QtXmlPatterns.so not found
--   PyQt4 module QtDBus.so not found
--   PyQt4 module QtMultimedia.so not found
--   PyQt4 module QtOpenGL.so not found
--   PyQt4 module QtTest.so not found
--   PyQt4 module Qsci.so not found
cp: cannot stat '/PyQt/uic': No such file or directory
ditto: can't get real path for source '/pylupdate4'
ditto: can't get real path for source '/pyrcc4'
-- Updating Qt library paths...
-- Up-to-date: /Users/liontooth/software/QGIS/QGIS-2.99/dist/QGIS.app/Contents/MacOS/bin/qgis_bench.app
-- Up-to-date: /Users/liontooth/software/QGIS/QGIS-2.99/dist/QGIS.app/Contents/MacOS/bin/qgis_bench.app/Contents
-- Up-to-date: /Users/liontooth/software/QGIS/QGIS-2.99/dist/QGIS.app/Contents/MacOS/bin/qgis_bench.app/Contents/Info.plist
-- Up-to-date: /Users/liontooth/software/QGIS/QGIS-2.99/dist/QGIS.app/Contents/MacOS/bin/qgis_bench.app/Contents/MacOS
-- Installing: /Users/liontooth/software/QGIS/QGIS-2.99/dist/QGIS.app/Contents/MacOS/bin/qgis_bench.app/Contents/MacOS/qgis_bench

How can I tell install to look for PyQt5?

History

#1 Updated by Joel Buckley about 7 years ago

David Liontooth wrote:

How can I tell install to look for PyQt5?

What were your cmake options? I have found that

-DQT_VERSION_MAJOR=5 -DPYQT4_BIN_DIR=/usr/local/bin

ameliorates some issues (though I am not 100% satisfied it makes everything go away).

Further, I suspect some changes need to be made in /mac/cmake/1qt.cmake.in (PyQt version 4 seems to be hard-coded in)

#2 Updated by David Liontooth about 7 years ago

Great, thanks. I've been using this, from David Marteau with supplements:

cmake $(CMAKE_OPTS) \
        -DWITH_ASTYLE=ON \
        -DCMAKE_INSTALL_PREFIX:PATH=$(INSTALL_PATH) \
        -DWITH_SERVER=ON \
        -DWITH_POSTGRESQL:BOOL=TRUE \
        -DPOSTGRES_CONFIG:FILEPATH=/opt/local/lib/postgresql96/bin/pg_config \
        -DWITH_GRASS7:BOOL=ON \
        -DLIBZIP_INCLUDE_DIR:PATH=/opt/local/include \
        -DLIBZIP_CONF_INCLUDE_DIR:FILEPATH=/opt/local/lib/libzip/include \
        -DLIBZIP_LIBRARY:FILEPATH=/opt/local/lib/libzip.dylib \
        -DEXPAT_INCLUDE_DIR:PATH=/opt/local/include \
        -DEXPAT_LIBRARY:FILEPATH=/opt/local/lib/libexpat.dylib \
        -DSQLITE3_INCLUDE_DIR:PATH=/opt/local/include \
        -DSQLITE3_LIBRARY:FILEPATH=/opt/local/lib/libsqlite3.dylib \
        -DQT_QMAKE_EXECUTABLE:FILEPATH=/opt/local/libexec/qt5/bin/qmake \
        -DQWT_INCLUDE_DIR:PATH=/opt/local/libexec/qt5/include/qwt \
        -DQWT_LIBRARY:FILEPATH=/opt/local/libexec/qt5/lib/libqwt.dylib \
        -DQCA_INCLUDE_DIR:PATH=/opt/local/libexec/qt5/include/QtCrypto \
        -DQCA_LIBRARY:FILEPATH=/opt/local/libexec/qt5/lib/libqca-qt5.dylib \
        -DQSCINTILLA_INCLUDE_DIR:PATH=/opt/local/libexec/qt5/include \
        -DQSCINTILLA_LIBRARY:FILEPATH=/opt/local/libexec/qt5/lib/libqscintilla2_qt5.dylib \
        -DQTKEYCHAIN_INCLUDE_DIR:PATH=/usr/local/include/qt5keychain \
        -DQTKEYCHAIN_LIBRARY:FILEPATH=/usr/local/lib/libqt5keychain.dylib \
        -DQT_LRELEASE_EXECUTABLE:FILEPATH=/opt/local/libexec/qt5/bin/lrelease \

The "-DWITH_GRASS7:BOOL=ON" option fails to find grass7 installed by MacPorts in /opt/local/share/grass-7.2.2.

As you say, pyqt4 is hardcoded in a few places in mac/cmake/1qt.cmake.in:

QGIS-2.99$ grep -i pyqt4 mac/cmake/1qt.cmake.in
            # MESSAGE (STATUS "ditto ${QARCHS} \"${PYQT4MOD}\" \"${QGISPYDIR}/${MODSUBPATH}\"")
        MESSAGE (STATUS "  PyQt4 module ${MODNAME} not found")
    UNSET(PYQT4MOD)
        EXECUTE_PROCESS (COMMAND ditto ${QARCHS} "@PYQT4_BIN_DIR@/${PU}" "${QBINDIR}/")
    EXECUTE_PROCESS (COMMAND sed -E "s, /.*/PyQt4/uic/pyuic.py, \"\$(/usr/bin/dirname \"\$0\")/../../Resources/python/PyQt4/uic/pyuic.py\"," "@PYQT4_BIN_DIR@/pyuic4" 

Is the goal to support both pyqt4 and 5?

Cheers,
David

#3 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Open to Feedback

Please check if this issue is still valid on QGIS 3.4.5 or 3.6.

Also available in: Atom PDF