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

RQT ModuleNotFoundError: No module named 'rclpy._rclpy'

asked 2020-12-01 19:41:24 -0600

mjwhite gravatar image

I get the following error when running rqt on MacOs (Mohave)

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/", line 87, in main
      File "/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/rqt_gui/", line 55, in main
        argv = rclpy.utilities.remove_ros_args(args=argv)
      File "/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/rclpy/", line 44, in remove_ros_args
        from rclpy.impl.implementation_singleton import rclpy_implementation
      File "/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/rclpy/impl/", line 31, in <module>
        rclpy_implementation = _import('._rclpy')
      File "/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/rclpy/impl/", line 28, in _import
        return importlib.import_module(name, package='rclpy')
      File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/", line 127, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
    ModuleNotFoundError: No module named 'rclpy._rclpy'
    The C extension '/Users/ros/ros2_foxy/ros2-osx/lib/python3.8/site-packages/rclpy/' isn't present on the system. Please refer to '' for possible solutions

It appears that at some point along the way the python version switches from 3.8 to 3.9

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-12-01 19:47:09 -0600

mjwhite gravatar image

It looks like the python3 version got upgraded after running Homebrew to install another package as seen by:

python3 --version
Python 3.9.0

I removed the symbolic link and pointed it to the previous version

rm /usr/local/bin/python3
ln -s /usr/local/Cellar/python@3.8/3.8.6_1/bin /usr/local/bin/python3

rqt ran sucessfully after that.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-12-01 19:41:24 -0600

Seen: 2,210 times

Last updated: Dec 01 '20