PyQt-related errors

Following the installation instructions I have set up a conda environment and then installed qiime2 there. But further qiime commands then produce the following error:

>qiime --help
QIIME is caching your current deployment for improved performance. This may take a few moments and should only happen once per deployment.
Traceback (most recent call last):
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/bin/qiime", line 6, in <module>
    sys.exit(q2cli.__main__.qiime())
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/click/core.py", line 696, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/click/core.py", line 621, in make_context
    self.parse_args(ctx, args)
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/click/core.py", line 1018, in parse_args
    rest = Command.parse_args(self, ctx, args)
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/click/core.py", line 880, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/click/core.py", line 1404, in handle_parse_result
    self.callback, ctx, self, value)
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/click/core.py", line 78, in invoke_param_callback
    return callback(ctx, param, value)
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/click/core.py", line 809, in show_help
    echo(ctx.get_help(), color=ctx.color)
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/click/core.py", line 496, in get_help
    return self.command.get_help(self)
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/click/core.py", line 830, in get_help
    self.format_help(ctx, formatter)
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/click/core.py", line 845, in format_help
    self.format_options(ctx, formatter)
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/click/core.py", line 956, in format_options
    self.format_commands(ctx, formatter)
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/click/core.py", line 1000, in format_commands
    for subcommand in self.list_commands(ctx):
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/q2cli/commands.py", line 69, in list_commands
    plugins = sorted(self._plugin_lookup)
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/q2cli/commands.py", line 53, in _plugin_lookup
    import q2cli.cache
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/q2cli/cache.py", line 305, in <module>
    CACHE = DeploymentCache()
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/q2cli/cache.py", line 61, in __init__
    self._state = self._get_cached_state(refresh=refresh)
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/q2cli/cache.py", line 107, in _get_cached_state
    self._cache_current_state(current_requirements)
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/q2cli/cache.py", line 200, in _cache_current_state
    state = self._get_current_state()
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/q2cli/cache.py", line 238, in _get_current_state
    plugin_manager = qiime2.sdk.PluginManager()
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/qiime2/sdk/plugin_manager.py", line 44, in __new__
    self._init()
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/qiime2/sdk/plugin_manager.py", line 58, in _init
    plugin = entry_point.load()
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/pkg_resources/__init__.py", line 2258, in load
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/pkg_resources/__init__.py", line 2264, in resolve
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/q2_diversity/__init__.py", line 9, in <module>
    from ._alpha import (alpha, alpha_phylogenetic, alpha_group_significance,
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/q2_diversity/_alpha/__init__.py", line 10, in <module>
    from ._method import (alpha, alpha_phylogenetic, phylogenetic_metrics,
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/q2_diversity/_alpha/_method.py", line 11, in <module>
    import skbio.diversity
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/skbio/__init__.py", line 13, in <module>
    import skbio.io  # noqa
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/skbio/io/__init__.py", line 238, in <module>
    import_module('skbio.io.format.lsmat')
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/skbio/io/format/lsmat.py", line 77, in <module>
    from skbio.stats.distance import DissimilarityMatrix, DistanceMatrix
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/skbio/stats/distance/__init__.py", line 192, in <module>
    from ._base import (DissimilarityMatrixError, DistanceMatrixError,
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/skbio/stats/distance/_base.py", line 12, in <module>
    import matplotlib.pyplot as plt
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/matplotlib/pyplot.py", line 115, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
    globals(),locals(),[backend_name],0)
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/matplotlib/backends/backend_qt5agg.py", line 16, in <module>
    from .backend_qt5 import QtCore
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/matplotlib/backends/backend_qt5.py", line 26, in <module>
    import matplotlib.backends.qt_editor.figureoptions as figureoptions
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/matplotlib/backends/qt_editor/figureoptions.py", line 20, in <module>
    import matplotlib.backends.qt_editor.formlayout as formlayout
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/matplotlib/backends/qt_editor/formlayout.py", line 56, in <module>
    from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore
  File "/home/grp2009/miniconda3/envs/qiime2-2017.6/lib/python3.5/site-packages/matplotlib/backends/qt_compat.py", line 128, in <module>
    from PyQt5 import QtCore, QtGui, QtWidgets
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

As a minimal error-producing action, if I load up Python and try the following import, I get the same type of error message:

>>> from PyQt5 import QtCore, QtGui, QtWidgets
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Actually, it’s enough to just import QtGui or QtWidgets. I’m running all of this on CentOS 6.8 Linux. I don’t have apt-get so this answer doesn’t help me, and I’m not working from a Docker image so this one doesn’t either.

Hi @Gregory_P — do you need to use Qt for anything? If not, go ahead and configure matplotlib to use an offscreen renderer. Then matplotlib will stop trying to import pyqt, etc. Thanks!

That does fix the problem, thanks! No, I don’t need Qt as far as I know.
Thanks

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.