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

Do I need to add <build_depend> entries for pure Python packages?

asked 2019-08-20 10:27:10 -0600

moooeeeep gravatar image

updated 2019-08-20 10:57:29 -0600

In the package.xml file we specify dependencies that we need at compile time for our package, e.g., as <build_depend>rospy</build_depend>.

As my Python package contains only Python code, that is not really compiled, do I actually have dependencies at compile time?

Or would it be enough to specify runtime dependencies for my example node?

Example (derived from this one):

<?xml version="1.0"?>
<package format="2">
  <description>The beginner_tutorials package</description>

  <maintainer email="you@yourdomain.tld">Your Name</maintainer>
  <url type="website"></url>
  <author email="you@yourdomain.tld">Jane Doe</author>




With a CMakeLists.txt, that I think, should go along these lines:

cmake_minimum_required(VERSION 2.8.3)

find_package(catkin REQUIRED COMPONENTS


edit retag flag offensive close merge delete


Please share your CMakeLists.txt which will allow to determine if the specified dependencies are sufficient. On a first look it should be good as is.

Dirk Thomas gravatar image Dirk Thomas  ( 2019-08-20 10:37:05 -0600 )edit

@DirkThomas I made up a CMakeLists.txt, but I'm again not sure, whether I actually need to define the REQUIRED COMPONENTS for catkin here...

moooeeeep gravatar image moooeeeep  ( 2019-08-20 10:45:06 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-08-20 10:56:08 -0600

Dirk Thomas gravatar image

You don't need the REQUIRED COMPONENTS rospy std_msgs in the find_package(catkin).

With those removed the stated dependencies (exec_depend on rospy and std_msgs without the need for build_depend) are sufficient.

Side note: you want to use catkin_install_python(...) instead of install(...) for your Python scripts since it will make sure to rewrite the shebang line of the script to the selected Python interpreter. The custom function takes the same arguments so you only need to change the function name.

edit flag offensive delete link more

Question Tools



Asked: 2019-08-20 10:27:10 -0600

Seen: 284 times

Last updated: Aug 20 '19