Hi there, there is a typo error in your module where you typed from my_custom_sev_msg_pkg import MyCustomServiceMessage, it should be my_custom_srv_msg_pkg
2 Likes
Oh, my bad. I have tried it multiple times but this time I think I happen to make a typo but even after correcting this I am getting the same error
rosrun unit_5_services something.py
Traceback (most recent call last):
File "/home/user/catkin_ws/src/unit_5_services/scripts/something.py", line 4, in <module>
from my_custom_srv_msg_pkg.srv import MyCustomServiceMessage,MyCustomServiceMessageResponse
ModuleNotFoundError: No module named 'my_custom_srv_msg_pkg'
I have also tried catkin build
followed by source devel/setup.bash
and running the program again but it gives the same error.
Ok, so I found the issue here. I did not add std_msgs
in find_package()
in CMakeList.txt
file. It works after making the above changes.
Thanks for the reply.
1 Like