Module "_commonqt5" not found error with Ubuntu 20.04

Hi everyone,

I got the workbench running on Ubuntu 20.04 for some time, then I did not use it for a while and when I canted to reopen the workbench again, I got an “ImportError” (see below).
I tried to build again Mantid with different versions but I still get this error.

It looks to me I have all the necessary libraries installed (Qt5, qtpy, PyQt5) and I can figure out what header is missing exactly.

Does anyone have some ideas about this?

Thanks in advance.

The error message:

Traceback (most recent call last):
  File "/opt/mantidunstable/lib/mantidqt/utils/qt/__init__.py", line 55, in import_qt
    lib = import_module(modulename + LIB_SUFFIX, package)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 556, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1166, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: /lib/x86_64-linux-gnu/libQt5Quick.so.5: undefined symbol: _ZNK11QFontEngine10glyphCacheEPKvNS_11GlyphFormatERK10QTransformRK6QColor, version Qt_5_PRIVATE_API

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/mantidunstable/lib/mantidqt/utils/qt/__init__.py", line 58, in import_qt
    lib = import_module(modulename.lstrip('.') + LIB_SUFFIX)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named '_commonqt5'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/mantidunstable/bin/workbench", line 11, in <module>
    load_entry_point('MantidWorkbench==6.1.20210726.628', 'gui_scripts', 'workbench')()
  File "/opt/mantidunstable/lib/workbench/app/main.py", line 62, in main
    start(options)
  File "/opt/mantidunstable/lib/workbench/app/main.py", line 86, in start
    from workbench.app.start import start
  File "/opt/mantidunstable/lib/workbench/app/start.py", line 30, in <module>
    from workbench.plugins.exception_handler import exception_logger  # noqa
  File "/opt/mantidunstable/lib/workbench/plugins/exception_handler/__init__.py", line 12, in <module>
    from mantidqt.dialogs.errorreports.report import CrashReportPage
  File "/opt/mantidunstable/lib/mantidqt/dialogs/errorreports/report.py", line 12, in <module>
    from mantidqt.interfacemanager import InterfaceManager
  File "/opt/mantidunstable/lib/mantidqt/interfacemanager.py", line 12, in <module>
    InterfaceManager = import_qt('._common', 'mantidqt', 'InterfaceManager')
  File "/opt/mantidunstable/lib/mantidqt/utils/qt/__init__.py", line 63, in import_qt
    raise ImportError(msg)
ImportError: First import of "._commonqt5" failed with "/lib/x86_64-linux-gnu/libQt5Quick.so.5: undefined symbol: _ZNK11QFontEngine10glyphCacheEPKvNS_11GlyphFormatERK10QTransformRK6QColor, version Qt_5_PRIVATE_API". Second import of "_commonqt5" failed with "No module named '_commonqt5'"
Traceback (most recent call last):
  File "/opt/mantidunstable/lib/mantidqt/utils/qt/__init__.py", line 55, in import_qt
    lib = import_module(modulename + LIB_SUFFIX, package)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 556, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1166, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: /lib/x86_64-linux-gnu/libQt5Quick.so.5: undefined symbol: _ZNK11QFontEngine10glyphCacheEPKvNS_11GlyphFormatERK10QTransformRK6QColor, version Qt_5_PRIVATE_API

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/mantidunstable/lib/mantidqt/utils/qt/__init__.py", line 58, in import_qt
    lib = import_module(modulename.lstrip('.') + LIB_SUFFIX)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named '_commonqt5'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/opt/mantidunstable/lib/mantidqt/dialogs/errorreports/main.py", line 16, in <module>
    from mantidqt.dialogs.errorreports.report import CrashReportPage
  File "/opt/mantidunstable/lib/mantidqt/dialogs/errorreports/report.py", line 12, in <module>
    from mantidqt.interfacemanager import InterfaceManager
  File "/opt/mantidunstable/lib/mantidqt/interfacemanager.py", line 12, in <module>
    InterfaceManager = import_qt('._common', 'mantidqt', 'InterfaceManager')
  File "/opt/mantidunstable/lib/mantidqt/utils/qt/__init__.py", line 63, in import_qt
    raise ImportError(msg)
ImportError: First import of "._commonqt5" failed with "/lib/x86_64-linux-gnu/libQt5Quick.so.5: undefined symbol: _ZNK11QFontEngine10glyphCacheEPKvNS_11GlyphFormatERK10QTransformRK6QColor, version Qt_5_PRIVATE_API". Second import of "_commonqt5" failed with "No module named '_commonqt5'"

Hi kpounot,

First to cover the usual disclaimers, 20.04 isn’t officially supported - might produce errors or incorrect data …etc…etc.

Also I notice you’ve got a Mantid unstable build? Is this something you’ve built for yourself?
The reason I ask is nightlies generally work fine, but a unstable build tends to be bespoke which makes it hard to know how far it’s deviated from the original source code.

Assuming it’s fairly close, this looks like Qt dependencies has changed since you’ve last built. Running _ZNK11QFontEngine10glyphCacheEPKvNS_11GlyphFormatERK10QTransformRK6QColor through a name demangler we get QFontEngine::glyphCache(void const*, QFontEngine::GlyphFormat, QTransform const&, QColor const&) const.

Some obvious ones:

  • Do you have a Conda env activated with Qt? this can cause problems where it will see the Conda version despite being built with the system (or vice-versa)
  • Have you re-built Mantid since updating your dependencies? If your looking to move off the unstable I would simply build Mantid locally without installing unstable packages, it’s relatively simple and I’m happy to explain how.
  • If you don’t want to mess too much and have the option of waiting potentially 3-6 months (as unlikely as that is) we will have 20.04 support through Conda with the work currently going on