Ros2 Launch file not found directory

Good day everyone, i have question on how to fix this error that i experience lately i dont know much about ROS2 i still new in this field robotics . Can you provide me some documentation or guidance

INFO] [launch]: All log files can be found below /home/dianne/.ros/log/2023-07-08-13-06-38-095053-dianne-3519
[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]: cannot import name ‘get_packages_share_directory’ from ‘ament_index_python.packages’ (/opt/ros/humble/lib/python3.10/site-packages/ament_index_python/

Hello @asdfgt112 ,

From the error message, I can see you are trying to import a method named get_packages_share_directory from ament_index_python. But this method is actually named get_package_share_directory (without the “s”). This should fix the error.

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