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

ModuleNotFoundError: No module named 'rclyp'

asked 2022-12-20 08:10:43 -0500

fkaan gravatar image
 #!/usr/bin/env python3

import rclyp

from rclyp.node import Node

def main(args = None):
    rclyp.init(args = args)
    node = Node("py_test")
    node.get_logger().info("Hello ROS2")
    rclyp.shutdown()

if __name__ == "__main__":
    main()

Hi I am new at ROS2 trying to use this code but my terminal says :

> user@user-VirtualBox:~/ros2_ws/src/my_py_pkg/my_py_pkg$
> ./my_first_node.py  Traceback (most
> recent call last):   File
> "/home/user/ros2_ws/src/my_py_pkg/my_py_pkg/./my_first_node.py", line 3, in <module>
>     import rclyp ModuleNotFoundError: No module named 'rclyp'

I have tried this link but It doesn't look like same error like I got.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-12-20 09:08:20 -0500

gvdhoorn gravatar image

updated 2022-12-20 09:08:46 -0500

The name of the Python client library for ROS 2 is rclpy.

You have:

import rclyp

you'll have to update all references to rclyp and replace them by rclpy.

edit flag offensive delete link more

Comments

sleep is a important think. Thank you a lot

fkaan gravatar image fkaan  ( 2022-12-20 10:47:05 -0500 )edit

Question Tools

Stats

Asked: 2022-12-20 08:10:43 -0500

Seen: 339 times

Last updated: Dec 20 '22