ModuleNotFoundError: No module named 'services_quiz' Problem in Quiz 6.4

Dear sir,

I noticed that [ngoducthinh0312] had the same problem with the first part of Quiz 6.4, I created the ‘services_quiz’ package, modified the CMakeLists.txt and package.xml according to the requirments. When i tested the bb8_move_custom_service_server.py, I got the same error message.


I attached here my CMakeLists.txt and package.xml as well. Can you please tell me what’s the problem?

It looks like you have not properly built and sourced the workspace.

Try this first:

source ~/catkin_ws/devel/setup.bash

Then run the command again.

If that did not work, do:

cd ~/catkin_ws
rm -rf build/ devel/
catkin_make
source devel/setup.bash

Then try running the command again. If you are running it in another terminal, run the following command first:

source ~/catkin_ws/devel/setup.bash

If it does not work after this, then review your CMakeLists.txt and package.xml for correctness.

Hello sir. I actually tried everything you mentioned step by step several times. I’m sure I properly built and sourced the workspace. I even deleted and started the Unit again and still I got those errors. I reviewed my CMakeLists.txt and package.xml for errors and correctness. I don’t know what else to do.

There must be a mistake somewhere. Check that there’s no typo in the name of the package.

Can you share a screenshot showing your full directory structure for the package?

Sure.
image

Unfortunately, the image you shared was too small and I could not see it clearly.

In any case, what is probably happening is that you have not set up your messages correctly. Can you check that the messages are built by running:

rossrv list | grep BB8

You should find a custom message like:

services_quiz/BB8CustomServiceMessage

If you can find the message, please show the output of the commands above.

If you can’t find it, please go over how to add a custom service message again and modify your package accordingly, then:

cd ~/catkin_ws
rm -rf build/ devel/
catkin_make
source devel/setup.bash

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