[ROS2] ModuleNotFoundError: No module named
from the examples of ROS 2 I tried to copy the AddTwoInts Example to my own package. ros2 run try_srv add_two_ints_server generates an error when importing AddTwoInts
ModuleNotFoundError: No module named 'try_srv'
thought the reason is that the idl file is not generated (can't find them in install or build folder).
Changing from try_srv.srv import AddTwoInts back to from example_interfaces.srv import AddTwoInts works fine
this is the folder structure
this is the package file
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>try_srv</name>
<version>0.0.1</version>
<description>migrated from examples</description>
<license>Apache License 2.0</license>
<buildtool_depend>rosidl_default_generators</buildtool_depend>
<exec_depend>rclpy</exec_depend>
<exec_depend>std_msgs</exec_depend>
<member_of_group>rosidl_interface_packages</member_of_group>
<export>
<build_type>ament_python</build_type>
</export>
</package>
is the folder and package.xml structure ok ?
if so what else could be the reason that the import fails ?
Can you please update your question with a link to the tutorial that you're referring to?