1

I have an Ubuntu 20.04.4 with ros noetic installed.

When I try to run rqt I have this error:

RosPluginProvider.load(qt_gui_cpp/CppPluginProvider) exception raised in __builtin__.__import__(qt_gui_cpp.cpp_plugin_provider, [CppPluginProvider]):
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_gui/ros_plugin_provider.py", line 79, in load
    module = __builtin__.__import__(
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui_cpp/cpp_plugin_provider.py", line 33, in <module>
    from .cpp_binding_helper import qt_gui_cpp
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui_cpp/cpp_binding_helper.py", line 43, in <module>
    from . import libqt_gui_cpp_sip
ValueError: PyCapsule_GetPointer called with incorrect name

RecursivePluginProvider.discover() loading plugin "qt_gui_cpp/CppPluginProvider" failed:
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/recursive_plugin_provider.py", line 60, in discover
    instance = self._plugin_provider.load(plugin_descriptor.plugin_id(), None)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_gui/ros_plugin_provider.py", line 90, in load
    raise e
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_gui/ros_plugin_provider.py", line 79, in load
    module = __builtin__.__import__(
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui_cpp/cpp_plugin_provider.py", line 33, in <module>
    from .cpp_binding_helper import qt_gui_cpp
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui_cpp/cpp_binding_helper.py", line 43, in <module>
    from . import libqt_gui_cpp_sip
ValueError: PyCapsule_GetPointer called with incorrect name

I tried to uninstall and install again ros/qt but it did not work.

I have PyQt5 5.14.1 and PyQt5-sip 12.9.1 installed with pip and pyqt5-dev 5.14.1 installed with apt. If I uninstall the python Qt packages, rqt relies on PySide2 (version 5.15.2.1 installed), but I have a segfault:

QtBindingHelper using pyside
PluginManager._discover() force discovery of plugins
RospkgPluginProvider._find_plugins() crawling for plugins of type 'qt_gui'
[1]    148476 segmentation fault (core dumped)  rqt
Apo
  • 15
  • 5

1 Answers1

0

I ran into the same problem and I fixed it by modifying my PYTHONPATH. It feels like I shouldn't need to do this, and something else is messing the PYTHONPATH, but hey, it works.

In my case I had:

root@pc:~# echo $PYTHONPATH
/opt/ros/noetic/lib/python3/dist-packages:

Added /opt/ros/noetic/lib/python3/dist-packages (found that path from the next step):

root@pc:~# export PYTHONPATH=$PYTHONPATH:/opt/ros/noetic/lib/python3/dist-packages
root@pc:~# echo $PYTHONPATH
/opt/ros/noetic/lib/python3/dist-packages:/usr/lib/python3/dist-packages

And I could use rqt tools.

I looked at where my PySide2 and PyQt5 were installed:

root@pc:~# find /usr -name PySide2
/usr/include/PySide2
/usr/lib/python3/dist-packages/PySide2
/usr/share/PySide2
root@pc:~# find /usr -name PyQt5
/usr/lib/python3/dist-packages/PyQt5
/usr/share/sip/PyQt5

And verified that my packages installed by apt where the only ones:

root@pc:~# dpkg -l | grep pyqt5
ii  pyqt5-dev                                   5.14.1+dfsg-3build1               all          Development files for PyQt5
ii  python3-pyqt5                               5.14.1+dfsg-3build1               amd64        Python 3 bindings for Qt5
ii  python3-pyqt5.qtsvg                         5.14.1+dfsg-3build1               amd64        Python 3 bindings for Qt5's SVG module
root@pc:~# dpkg -l | grep pyside
ii  libpyside2-dev                              5.14.0-1~exp1ubuntu5              amd64        Python bindings for Qt5 (development files)
ii  libpyside2-py3-5.14                         5.14.0-1~exp1ubuntu5              amd64        Python 3 bindings for Qt5 (base files)
ii  python3-pyside2.qtcore                      5.14.0-1~exp1ubuntu5              amd64        Python bindings for Qt5 core module (Python 3)
ii  python3-pyside2.qtgui                       5.14.0-1~exp1ubuntu5              amd64        Python bindings for Qt5 Gui module (Python 3)
ii  python3-pyside2.qtsvg                       5.14.0-1~exp1ubuntu5              amd64        Python bindings for Qt5 Svg module (Python 3)
ii  python3-pyside2.qtwidgets                   5.14.0-1~exp1ubuntu5              amd64        Python bindings for Qt5 Widgets module (Python 3)

pip3 showed no packages installed:

pip3 freeze | grep -i pyside

I ran also into this error while installing/uninstalling with pip3 packages (to ease google searches that get here):

Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/python_qt_binding/binding_helper.py", line 108, in _select_qt_binding
    QT_BINDING_VERSION = binding_loader(required_modules, optional_modules)
  File "/opt/ros/noetic/lib/python3/dist-packages/python_qt_binding/binding_helper.py", line 185, in _load_pyside
    _named_import('PySide2.%s' % module_name)
  File "/opt/ros/noetic/lib/python3/dist-packages/python_qt_binding/binding_helper.py", line 133, in _named_import
    module = builtins.__import__(name)
ModuleNotFoundError: No module named 'PySide2'
awesomebytes
  • 11
  • 1
  • 6