ROS2 - ModuleNotFoundError: No module named 'rclpy._rclpy'


I run a ROS2 Node which publishes positions (X,Y,Z). In IsaacSIM I want to subscribe to this topic and move the DigitalTwin to the published positions .

Unfortunately I cant create any ROS2 node or subscribe to any topic in IsaacSIM.
when importing Subscriptions:

from rclpy.subscription import Subscription

I geht the following error message:

Traceback (most recent call last):
  File "/home/isy/workspace/src/ISY-Project_UR5e/ur_isaacsim/", line 20, in <module>
    from rclpy.subscription import Subscription
  File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/", line 19, in <module>
    from rclpy.handle import Handle
  File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/", line 17, in <module>
    from rclpy.impl.implementation_singleton import rclpy_handle_implementation as _rclpy_handle
  File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/impl/", line 31, in <module>
    rclpy_implementation = _import('._rclpy')
  File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/impl/", line 28, in _import
    return importlib.import_module(name, package='rclpy')
  File "/home/isy/.local/share/ov/pkg/isaac_sim-2022.1.1/kit/python/lib/python3.7/importlib/", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'rclpy._rclpy'
The C extension '/opt/ros/foxy/lib/python3.8/site-packages/rclpy/' isn't present on the system. Please refer to '' for possible solutions

How can I get rid of this error message?
Many thanks in advance!

Ubuntu 20.04
ROS2 Foxy
IsaacSIM 2022.1.1

Script is running via:

source /opt/ros/foxy/setup.zsh
cd ~/.local/share/ov/pkg/isaac_sim-2022.1.1/
declare -x LD_LIBRARY_PATH="/exts/omni.isaac.ros2_bridge/bin/"
 ./ ~/workspace/src/ISY-Project_UR5e/ur_isaacsim/"

Meanwhile I found my error.

Every time I opened a terminal I sourced ROS2 Foxy and the ros2_workspace by default via the .zshrc (.bashrc).
This led to the unwanted behavior.

When opening a terminal to launch the IsaacSIM script I now source:

source ~/.local/share/ov/pkg/isaac_sim-2022.1.1/ros2_workspace/install/local_setup.zsh

And when I open the second terminal to run the ROS2 Nodes I source:

source /opt/ros/foxy/setup.zsh
source ~/workspace/install/setup.zsh 

Now everything works as intended

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.