Cmake failed and python error no module named service_quiz

I think this is the reason why python file is unable to import .srv file.
I tried catkin_make,source devel/setup.bash
It is showing the custom service when I type rossrv list | grep BB8CustomServiceMessage.
I deleted even build and devel folders and then created it by catkin_make -doesn’t work
I made sure that CmakeList and package.xml are edited correctly.
Nothing I know works please anyone help??

Base path: /home/user/catkin_ws
Source space: /home/user/catkin_ws/src
Build space: /home/user/catkin_ws/build
Devel space: /home/user/catkin_ws/devel
Install space: /home/user/catkin_ws/install

Running command: “cmake /home/user/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/user/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/user/catkin_ws/install -G Unix Makefiles” in “/home/user/catkin_ws/build”

– The C compiler identification is GNU 5.4.0
– The CXX compiler identification is GNU 5.4.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Using CATKIN_DEVEL_PREFIX: /home/user/catkin_ws/devel
– Using CMAKE_PREFIX_PATH: /home/user/catkin_ws/devel;/home/simulations/public_sim_ws/devel;/opt/ros/kinetic
– This workspace overlays: /home/user/catkin_ws/devel;/home/simulations/public_sim_ws/devel;/opt/ros/kinetic
– Found PythonInterp: /usr/bin/python2 (found suitable version “2.7.12”, minimum required is “2”)
– Using PYTHON_EXECUTABLE: /usr/bin/python2
– Using Debian Python package layout
– Using empy: /usr/bin/empy
– Using CATKIN_ENABLE_TESTING: ON
– Call enable_testing()
– Using CATKIN_TEST_RESULTS_DIR: /home/user/catkin_ws/build/test_results
– Found gmock sources under ‘/usr/src/gmock’: gmock will be built
– Found PythonInterp: /usr/bin/python2 (found version “2.7.12”)
– Looking for pthread.h
– Looking for pthread.h - found
– Looking for pthread_create
– Looking for pthread_create - not found
– Looking for pthread_create in pthreads
– Looking for pthread_create in pthreads - not found
– Looking for pthread_create in pthread
– Looking for pthread_create in pthread - found
– Found Threads: TRUE
– Found gtest sources under ‘/usr/src/gmock’: gtests will be built
– Using Python nosetests: /usr/local/bin/nosetests-2.7
– catkin 0.7.18
– BUILD_SHARED_LIBS is on
– BUILD_SHARED_LIBS is on
– ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
– ~~ traversing 8 packages in topological order:
– ~~ - my_custom_srv_msg_pkg
– ~~ - my_package
– ~~ - my_pkg_exercise
– ~~ - package_age
– ~~ - package_odometry
– ~~ - services_quiz
– ~~ - topics_quiz
– ~~ - unit_4_services
– ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
– +++ processing catkin package: ‘my_custom_srv_msg_pkg’
– ==> add_subdirectory(my_custom_srv_msg_pkg)
– Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
– my_custom_srv_msg_pkg: 0 messages, 1 services
– +++ processing catkin package: ‘my_package’
– ==> add_subdirectory(my_package)
– +++ processing catkin package: ‘my_pkg_exercise’
– ==> add_subdirectory(my_pkg_exercise)
– +++ processing catkin package: ‘package_age’
– ==> add_subdirectory(package_age)
– Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
– package_age: 1 messages, 0 services
– +++ processing catkin package: ‘package_odometry’
– ==> add_subdirectory(package_odometry)
– +++ processing catkin package: ‘services_quiz’
– ==> add_subdirectory(services_quiz)
CMake Error: Error in cmake code at
/home/user/catkin_ws/src/services_quiz/CMakeLists.txt:208:
Parse error. Function missing ending “)”. End of file reached.
– +++ processing catkin package: ‘topics_quiz’
– ==> add_subdirectory(topics_quiz)
– +++ processing catkin package: ‘unit_4_services’
– ==> add_subdirectory(unit_4_services)
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
Could not find a package configuration file provided by
“irim_wam_reproduce_trajectory” with any of the following names:

irim_wam_reproduce_trajectoryConfig.cmake
irim_wam_reproduce_trajectory-config.cmake

Add the installation prefix of “irim_wam_reproduce_trajectory” to
CMAKE_PREFIX_PATH or set “irim_wam_reproduce_trajectory_DIR” to a directory
containing one of the above files. If “irim_wam_reproduce_trajectory”
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
unit_4_services/CMakeLists.txt:10 (find_package)

– Could not find the required component ‘irim_wam_reproduce_trajectory’. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by
“irim_wam_reproduce_trajectory” with any of the following names:

irim_wam_reproduce_trajectoryConfig.cmake
irim_wam_reproduce_trajectory-config.cmake

Add the installation prefix of “irim_wam_reproduce_trajectory” to
CMAKE_PREFIX_PATH or set “irim_wam_reproduce_trajectory_DIR” to a directory
containing one of the above files. If “irim_wam_reproduce_trajectory”
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
unit_4_services/CMakeLists.txt:10 (find_package)

– Configuring incomplete, errors occurred!
See also “/home/user/catkin_ws/build/CMakeFiles/CMakeOutput.log”.
See also “/home/user/catkin_ws/build/CMakeFiles/CMakeError.log”.
Invoking “cmake” failed
ceback (most recent call last):
File “/home/user/catkin_ws/src/services_quiz/src/bb8_move_custom_service_server.py”, line 3, in
from services_quiz.srv import BB8CustomServiceMessage,BB8CustomServiceMessageResponse
ImportError: No module named services_quiz.srv
[bb8_server_node-1] process has died [pid 13807, exit code 1, cmd /home/user/catkin_ws/src/services_quiz/src/bb8_move_custom_service_server.py __name:=bb8_server_node __log:=/home/user/.ros/log/4bb5117e-dbf7-11ea-ba57-06feb75306bc/bb8_server_node-1.log].
log file: /home/user/.ros/log/4bb5117e-dbf7-11ea-ba57-06feb75306bc/bb8_server_node-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor…
… shutting down processing monitor complete

Hi @yashsury2001,
I think this line tells you the problem. See if that helps :slight_smile:
(in case you dont know how to read it, it means that the file /home/user/catkin_ws/src/services_quiz/CMakeLists.txt has a issue at line 208

Thankyou very much.
I got it working.