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

When should I use rosdep and when should I use apt or pip?

asked 2018-04-04 15:51:03 -0500

nbro gravatar image

updated 2018-04-04 15:55:11 -0500

rosdep can be used to install ROS packages or system dependencies (i.e. everything which is not a ROS package). There are dependencies used by certain ROS packages (but not only), which can be installed using apt or pip. For example, rosdep itself can be installed using apt or pip.The tool rqt_plot can be installed using rosdep or using e.g. sudo apt-get install ros-indigo-rqt (as stated here: ).

Why are there multiple tools to manage and install dependencies (for our ROS packages)? Why are there multiple ways to install ROS packages? When should I use rosdep and when should I use apt or pip?

We can have a look at the documentation, but I have always to have a look at the documentation, that's a little bit annoying! If I had only one way of managing dependencies, I would not have to always look at the documentation.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-04-05 00:59:57 -0500

mgruhler gravatar image

Short answer

You don't need to use rosdep, but it simplifies and speeds things up a lot.

Long answer

First of, I'll quote the rosdep docs:

rosdep is a command-line tool for installing system dependencies. For end-users, rosdep helps you install system dependencies for software that you are building from source. For developers, rosdep simplifies the problem of installing system dependencies on different platforms. Instead of having to figure out which debian package on Ubuntu Oneiric contains Boost, you can just specify a dependency on 'boost'. rosdep is supported on a variety of platforms/package managers:

  • Ubuntu (apt)
  • Debian (apt)
  • OS X (Homebrew)
  • Red Hat Enterprise Linux (rpm/experimental)
  • Arch (pacman/experimental)
  • Gentoo (equery/experimental)
  • Slackware (sbotools/experimental)
  • Cygwin (experimental)

Basically, rosdep is a utility to easily install dependencies that are released as (Debian, for Ubuntu/Debian) packages (or sometimes as python packages via pip) when building something from source.

You don't need to use rosdep, it just makes life easier when installing something from source and it is cross-platform. So, if you are developing cross-platform, you can stick to one workflow.

On ubuntu, rosdep is in the end just calling apt (or in a few occasions pip) to install the realeased packages you need.

You could do this manually, but would have to check the docs of the packages you want to compile, or the package.xml.

So what to use when? (my personal stance, others might differ, and not in any specific order)

  • Basic Installation (i.e. new ROS): apt
  • You know exactly what you need (you develop a new package and add a dep you don't have installed yet): apt
  • The dep I need is not in apt: pip
  • I cloned some repos and want everything I need to compile (new set of packages, new computer, ...): rosdep
edit flag offensive delete link more



This makes sense, but I would add that using pip should always be done "carefully" on a system that also has a package manager (such as apt or rpm), as pkgs installed via pip will not register in the pkg db of those tools. This can lead to issues ("polluting" a system).

gvdhoorn gravatar image gvdhoorn  ( 2018-04-05 01:59:13 -0500 )edit

Note that my comment is a general one, it's not specific to ROS. Circumventing the system pkg manager is always something that should be done with care.

gvdhoorn gravatar image gvdhoorn  ( 2018-04-05 01:59:52 -0500 )edit

@gvdhoorn, I completely agree. Thus my third point "if not in apt: pip".

mgruhler gravatar image mgruhler  ( 2018-04-05 02:19:11 -0500 )edit

We're saying the same thing, I was not contradicting you in any way. I just wanted to add some emphasis to the "avoid pip if possible" bit.

All too often I see people installing everything using pip, "just because it works".

But as I wrote earlier, this is a general problem, not a ROS one.

gvdhoorn gravatar image gvdhoorn  ( 2018-04-05 03:59:39 -0500 )edit

again, totally agree :-) And I did not feel like I was being contradicted :-)

mgruhler gravatar image mgruhler  ( 2018-04-05 05:58:33 -0500 )edit

Question about installing with pip - When you're talking about installing a package with pip, are you talking about doing a system level pip install? shudder ... or is there someway to install pip packages just for the catking workspace / package being developed

jstm gravatar image jstm  ( 2021-08-28 11:56:43 -0500 )edit

@jstmcatkin_virtualenv says it can "bundle a virtualenv within a catkin package", though I have not tried it myself

cyberguy42 gravatar image cyberguy42  ( 2021-11-11 15:22:37 -0500 )edit

Question Tools



Asked: 2018-04-04 15:51:03 -0500

Seen: 9,630 times

Last updated: Apr 05 '18