Ask Your Question
0

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

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

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

1 Answer

Sort by ยป oldest newest most voted
3

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

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

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 -0600 )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 -0600 )edit

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

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

You are welcome!

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 1,247 times

Last updated: Nov 18 '20