Launch file not found


until end of section 2.6 I think I followed all steps. Still when launching the first launch file after

ros2 launch my_package

I get

file '' was not found in the share directory of package 'my_package' which is at '/home/user/ros2_ws/src/install/my_package/share/my_package'

but it exists in


any hint why the build didn’t add the launch File to the package ?

Hi @vkuehn ,

I believe, it is because you might have missed some line(s) in your file.

Check if you have done the following steps: (specifically step 2 in the below snippet)

Make changes to file:
Add: import os
Add: from glob import glob

Add to data_files list: (os.path.join('share', package_name), glob('launch/*'))

Add to entry_points dict console_scripts: 
['python_executable_name = pkg_name.python_executable_name:main']

And make sure your file is in this format:

Generate Launch File:
from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
    return LaunchDescription([

I believe, these should fix your problem!

Let me know if you find what I said to be helpful !


1 Like

That did make it work, Thanks a lot !

The Import for the setup was missing.

1 Like