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

How does colcon install Python dependencies in ROS2?

asked 2020-02-07 11:54:06 -0500

screen33 gravatar image

Can Colcon with ament_python install dependencies from by itself during colcon build --symlink-install step? e.g. I would like pyserial to be automatically retrieved from pypi and installed without invoking pip3 manually:

   install_requires=['setuptools', 'pyserial']
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-02-07 11:58:00 -0500

Dirk Thomas gravatar image

colcon doesn't install any dependencies (see the docs). The expectations is that you have installed all necessary dependencies before you try to build a package (e.g. using rosdep).

edit flag offensive delete link more


Ah, yes. But it complains: ModuleNotFoundError: No module named 'rosdep2'. I do have multiple Python interpreters on this machine, however default is py3.6

screen33 gravatar image screen33  ( 2020-02-07 12:24:16 -0500 )edit

You need to install dependencies for the specific Python version you are using. If you use Python 3.6 you need to have python3-rosdep installed. If you also have ROS 1 / python-rosdep installed it is sufficient to just install python3-rosdep-modules (all assuming you are on Ubuntu using the ROS apt repos).

Dirk Thomas gravatar image Dirk Thomas  ( 2020-02-07 12:37:26 -0500 )edit

I also have ROS melodic, but I guess this is why I'm getting conflicts: python3-rosdep : Depends: python3-catkin-pkg but it is not going to be installed

screen33 gravatar image screen33  ( 2020-02-07 12:47:30 -0500 )edit

Question Tools



Asked: 2020-02-07 11:54:06 -0500

Seen: 1,079 times

Last updated: Feb 07 '20