ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ROS CMake Error 'catkin_python_setup() called without 'setup.py' in project folder''

asked 2022-02-23 07:48:28 -0500

junulee gravatar image

I have met that kind of error.

My ROS version is kinetic.

Linux version is Ubuntu.

CMake file is following.

cmake_minimum_required(VERSION 3.0.2)

find_package(catkin REQUIRED COMPONENTS
  roscpp
  std_msgs
)

find_package(Boost REQUIRED COMPONENTS system)

catkin_python_setup()

add_message_files(
  FILES
  Message1.msg
  Message2.msg
)

add_service_files(
  FILES
  Service1.srv
  Service2.srv
)

generate_messages(
  DEPENDENCIES
  std_msgs
)

generate_dynamic_reconfigure_options(
  cfg/DynReconf1.cfg
  cfg/DynReconf2.cfg
)

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES my_first_ros_pkg
  CATKIN_DEPENDS roscpp std_msgs
  DEPENDS system_lib
)

include_directories(
  ${catkin_INCLUDE_DIRS}
)

add_library(my_first_ros_pkg
  src/${PROJECT_NAME}/my_first_ros_pkg.cpp
)

add_dependencies(my_first_ros_pkg ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

add_executable(hello_world_node src/hello_world_node.cpp)

add_dependencies(my_first_ros_pkg_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

target_link_libraries(my_first_ros_pkg_node
  ${catkin_LIBRARIES}
)

Error message

CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkin_python_setup.cmake:31 (message):
  catkin_python_setup() called without 'setup.py' in project folder '
  /home/rosjunu/catkin_ws/src/my_first_ros_pkg'
Call Stack (most recent call first):
  my_first_ros_pkg/CMakeLists.txt:23 (catkin_python_setup)


-- Configuring incomplete, errors occurred!
See also "/home/rosjunu/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/rosjunu/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:542: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-02-23 18:14:53 -0500

updated 2022-02-24 18:16:01 -0500

The key message in the error is this:

  catkin_python_setup() called without 'setup.py' in project folder ' /home/rosjunu/catkin_ws/src/my_first_ros_pkg'

In your CMakeLists.txt file, just below the find_package(Boost REQUIRED COMPONENTS system) you have a call to catkin_python_setup(). This macro is designed to process setup.py files for ROS packages that also provide Python modules or scripts. See the relevant documentation.

Bottom line:

  • If your package does provide a Python module then you need to write an appropriate setup.py.
  • If your package does not provide a Python module then you should remove the call to catkin_python_setup() from your CMakeLists.txt
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-02-23 07:43:22 -0500

Seen: 1,193 times

Last updated: Feb 24 '22