cannot import name 'sip' from 'PyQt5' (Linux)

Issue #718 on hold
Benjamin Jakimow created an issue

In some linux environments import sip fails.
refs to: https://github.com/qgis/QGIS/issues/45169

root@106cc5a953e7:/enmap-box# python3 scripts/setup_repository.py
setup repository
Application path not initialized
Traceback (most recent call last):
  File "scripts/setup_repository.py", line 36, in <module>
    setup_enmapbox_repository()
  File "scripts/setup_repository.py", line 19, in setup_enmapbox_repository
    from scripts.install_testdata import install_qgisresources, install_enmapboxtestdata
  File "/enmap-box/scripts/install_testdata.py", line 8, in <module>
    from enmapbox import URL_TESTDATA, URL_QGIS_RESOURCES, DIR_REPO
  File "/enmap-box/enmapbox/__init__.py", line 430, in <module>
    from enmapbox.gui.enmapboxgui import EnMAPBox
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/enmap-box/enmapbox/gui/__init__.py", line 4, in <module>
    from ..externals.qps.plotstyling.plotstyling import PlotStyle, PlotStyleDialog, PlotStyleButton, PlotStyleWidget
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/enmap-box/enmapbox/externals/qps/plotstyling/plotstyling.py", line 40, in <module>
    from ..externals import pyqtgraph as pg
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/enmap-box/enmapbox/externals/qps/externals/pyqtgraph/__init__.py", line 13, in <module>
    from .Qt import QtCore, QtGui, mkQApp
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/enmap-box/enmapbox/externals/qps/externals/pyqtgraph/Qt/__init__.py", line 155, in <module>
    from PyQt5 import sip, uic
ImportError: cannot import name 'sip' from 'PyQt5' (/usr/lib/python3/dist-packages/PyQt5/__init__.py)

Comments (17)

  1. Andreas Janz

    The bar is not showing anymore, but in the console I get:

    Unable to import PyQt5-sip:
    No module named 'PyQt5-sip'
    D:\miniconda\envs\qgis\lib\importlib_bootstrap.py:219: RuntimeWarning: numpy.ndarray size changed, may indicate binary incompatibility. Expected 16 from C header, got 88 from PyObject
    return f(*args, **kwds)
    Unable to import PyQt5-sip:

  2. Andreas Janz

    Regarding the initial problem with setup_enmapbox_repository: this is only relevant for developers I guess.

    I can’t reproduce the error on my Win10 system.

  3. Log in to comment