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

rqt ImportError for 'pyqt': No module named 'PyQt5'

asked 2020-11-18 00:11:47 -0500

mjwhite gravatar image

I installed ROS2 Foxy on my Macbook (Mojave) following instructions at https://index.ros.org/doc/ros2/Instal...

When I run rqt I get the following error:

Traceback (most recent call last):

File "/Users/ros/ros2_foxy/ros2-osx/bin/rqt", line 33, in <module>
    sys.exit(load_entry_point('rqt-gui==1.0.6', 'console_scripts', 'rqt')())

File "/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/rqt_gui/main.py", line 87, in main
    sys.exit(Main().main())
File "/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/rqt_gui/main.py", line 57, in main
    return super(
File "/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/qt_gui/main.py", line 410, in main
    from python_qt_binding import QT_BINDING
  File "/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/python_qt_binding/__init__.py", line 56, in <module>
    from python_qt_binding.binding_helper import loadUi  # noqa: F401
  File "/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/python_qt_binding/binding_helper.py", line 277, in <module>
    _select_qt_binding(
  File "/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/python_qt_binding/binding_helper.py", line 118, in _select_qt_binding
    raise ImportError(
ImportError: Could not find Qt binding (looked for: 'pyqt', 'pyside'):
ImportError for 'pyqt': No module named 'PyQt5'
Traceback (most recent call last):
  File "/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/python_qt_binding/binding_helper.py", line 108, in _select_qt_binding
  QT_BINDING_VERSION = binding_loader(required_modules, optional_modules)
  File "/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/python_qt_binding/binding_helper.py", line 153, in _load_pyqt
    _named_import('PyQt5.%s' % module_name)
  File "/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/python_qt_binding/binding_helper.py", line 133, in _named_import
    module = builtins.__import__(name)
ModuleNotFoundError: No module named 'PyQt5'

 ImportError for 'pyside': No module named 'PySide2'
Traceback (most recent call last):
  File "/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/python_qt_binding/binding_helper.py", line 108, in _select_qt_binding
    QT_BINDING_VERSION = binding_loader(required_modules, optional_modules)
  File "/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/python_qt_binding/binding_helper.py", line 185, in _load_pyside
_named_import('PySide2.%s' % module_name)
  File "/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/python_qt_binding/binding_helper.py", line 133, in _named_import
    module = builtins.__import__(name)
ModuleNotFoundError: No module named 'PySide2'

I've searched all similar errors and cannot find anything specific to ros2 install on MacOS. I've been working on this for a few days now and still do not have a fully working install on Mac. I've also tried using a Docker install (no luck there either). If anyone has been able to install ros2 successfully on a Mac could you please assist. Thank you.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-01-09 14:23:06 -0500

offgrid8 gravatar image

you don't have Connext or OpenSplice installed (which is fine).

colcon build --symlink-install --packages-ignore qt_gui_cpp rqt_gui_cpp

edit flag offensive delete link more
3

answered 2020-11-18 04:02:52 -0500

updated 2020-11-18 04:03:54 -0500

Run which pip to get the location of the default pip.

Assuming it returns /usr/bin/pip , navigate to /usr/bin and then run pip install PySide2.

If it still doesn't work, then get location of pip3 using which pip3. Naviagte to the location and then run pip3 install PySide2.

Hope this helps.

edit flag offensive delete link more

Comments

That did solve the issue. Thank you.

mjwhite gravatar image mjwhite  ( 2020-11-18 14:11:04 -0500 )edit

You can accept my answer as correct or post your own with an explanation. Cheers!

skpro19 gravatar image skpro19  ( 2020-11-18 17:42:42 -0500 )edit

same error, your pip3 fix worked for me THANK YOU :-)

nink gravatar image nink  ( 2020-12-10 13:17:15 -0500 )edit

You are welcome!

skpro19 gravatar image skpro19  ( 2021-01-03 15:15:44 -0500 )edit

On macOS Monterrey, which pip returns /usr/local/bin/pip and which pip3 returns /usr/local/bin/pip3. Running pip install PySide2 --user did not make rqt succeed, but pip3 install PySide2 --user worked!

wgrand gravatar image wgrand  ( 2021-12-29 07:26:25 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2020-11-18 00:11:47 -0500

Seen: 2,835 times

Last updated: Jan 09 '22