# Service Message problem

**URL:** <https://get-help.theconstruct.ai/t/service-message-problem/35685>\
**Category:** Open Discussions\
**Created:** [April 6, 2025, 7:30am UTC](https://get-help.theconstruct.ai/t/service-message-problem/35685 "2025-04-06T07:30:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shili](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/s/e56c9b/32.png) [@shili](https://get-help.theconstruct.ai/u/shili)\
**Post date:** [April 6, 2025, 7:30am UTC](https://get-help.theconstruct.ai/t/service-message-problem/35685/1 "2025-04-06T07:30:59Z")

</div>

I followed the whole instruction of lesson “6.4 Custom Service Messages” but when I did catkin\_make I didn’t see this line: _ **Generating Python code from SRV my\_custom\_srv\_msg\_pkg/MyCustomServiceMessage** _  
But I see the created service among the rossrv list: my\_custom\_srv\_msg\_pkg/MyCustomServiceMessage  
Furthermore, when I create Service Server that uses this type of message and try to run it with this command:  
rosrun my\_custom\_srv\_msg\_pkg testCustemService.py  
I will receive this error:  
Traceback (most recent call last):  
File “/home/user/catkin\_ws/src/my\_custom\_srv\_msg\_pkg/scripts/testCustemService.py”, line 4, in   
from my\_custom\_srv\_msg\_pkg.srv import MyCustomServiceMessage, MyCustomServiceMessageResponse # you import the service message python classes  
ModuleNotFoundError: No module named ‘my\_custom\_srv\_msg\_pkg’

 ![Screenshot 1404-01-17 at 09.27.01](https://get-help.theconstruct.ai/uploads/default/original/2X/f/f8c658db51cd8d8bd2a0f930b691f5f0359d35b7.jpeg)

---

<div class="post-metadata">

**Author:** ![rodrigo55](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/rodrigo55/32/7280_2.png) [@rodrigo55](https://get-help.theconstruct.ai/u/rodrigo55)\
**Post date:** [April 7, 2025, 7:51am UTC](https://get-help.theconstruct.ai/t/service-message-problem/35685/2 "2025-04-07T07:51:13Z")

</div>

Hi @shili, you can try forcing the custom service package recompilation by deleting the `/build` and `/devel` directories. You can also ensure you are compiling the custom message package by using the `-DCATKIN_WHITELIST_PACKAGES` flag.

Then, make sure you source the workspace in the terminal you are running the server that uses your custom service:

```auto
cd ~/catkin_ws && rm -rf build/ devel/
catkin_make -DCATKIN_WHITELIST_PACKAGES="your_package_name"
source devel/setup.bash
```

---

<div class="post-metadata">

**Author:** ![shili](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/s/e56c9b/32.png) [@shili](https://get-help.theconstruct.ai/u/shili)\
**Post date:** [April 7, 2025, 11:28am UTC](https://get-help.theconstruct.ai/t/service-message-problem/35685/3 "2025-04-07T11:28:17Z")

</div>

Thanks a lot @rodrigo55, the problem is solved by recompilation.

---

<div class="post-metadata">

**Author:** ![system](https://get-help.theconstruct.ai/uploads/default/original/2X/9/9d3ce8305cc0d0d9b6e07d15767a6f245c526f1b.jpeg) [@system](https://get-help.theconstruct.ai/u/system)\
**Post date:** [April 14, 2025, 11:28am UTC](https://get-help.theconstruct.ai/t/service-message-problem/35685/4 "2025-04-14T11:28:28Z")

</div>

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