Module not found in 2.6

I get the following error after having copy pasted the necessary python files. It seems that python is not loading in the packages?

user:~/ros2_ws$ ros2 launch my_package
[INFO] [launch]: All log files can be found below /home/user/.ros/log/2024-02-05-12-29-07-479946-3_xterm-3843
[INFO] [launch]: Default logging verbosity is set to INFO
[ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught exception when trying to load file of format [py]: No module named ‘launch.ros’

Copy pasting won’t work unless you have done the steps correctly. After copy-pasting, make sure you have modified all required files, recompiled and sourced the workspace before running the ros2 launch command.

Hi @albin.magnu ,

Welcome to this Community!

I think you have a typo error in your launch file.

The word should be launch_ros and not launch.ros.

This change should fix your issue, let me know if this does not.


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