ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Error using RQT - Could not import "pyqt" bindings of qt_gui_cpp library

asked 2020-11-27 20:13:21 -0500

liamr0y gravatar image

updated 2020-12-16 03:03:04 -0500

mgruhler gravatar image

Every time I try to use anything RQT (rqt_console, rqt_graph, etc.) I get this error (see below). Not sure how to fix this. When I do Python --version I get Python 3.7, however I ensured my environment variable $ROS_PYTHON_VERSION=2. Im on Ubuntu 18.04 using Melodic

~~~

Could not import "pyqt" bindings of qt_gui_cpp library - so C++ plugins will not be available:
Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python2.7/dist-packages/qt_gui_cpp/cpp_binding_helper.py", line 43, in <module>
    from . import libqt_gui_cpp_sip
ImportError: dynamic module does not define module export function (PyInit_libqt_gui_cpp_sip)

~~~

Note this output when I run "$ env | grep PYTHON":

CONDA_PYTHON_EXE=/home/parallels/anaconda3/bin/python
ROS_PYTHON_VERSION=2
PYTHONPATH=/home/parallels/catkinws_melodic/devel/lib/python2.7/dist-packages:/opt/ros/melodic

How do I stop getting this error when I try to use RQT?

edit retag flag offensive close merge delete

Comments

Hi,

I have the same issue as you have so unfortunately I don't know the answer yet. Did you meanwhile solve this error? If yes, could you please help me out? If no, I will continue to search for an answer and maybe I will be able to help you out! I couldn't find a lot of other topics related to this error.

Best,

alme96

alme96 gravatar image alme96  ( 2020-12-15 09:40:58 -0500 )edit

The first step would be to make sure /usr/bin/python is a symbolic link to `python2.7'.

$ ls -l /usr/bin/python
lrwxrwxrwx 1 root root       9 Apr 16  2018 /usr/bin/python -> python2.7
Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-06-03 14:11:26 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-06-03 12:39:35 -0500

I had the same problem, and solved it as follows:

gives a priority of 1 for the path of python3

[sudo] update-alternatives --install /usr/bin/python python /usr/bin/python3 1

gives a priority of 2 for the path of python2 (highest priority)

[sudo] update-alternatives --install /usr/bin/python python /usr/bin/python2 2
edit flag offensive delete link more

Question Tools

Stats

Asked: 2020-11-27 20:13:21 -0500

Seen: 493 times

Last updated: Jun 03 '22