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

Triggering pip requirements.txt from catkin build

asked 2015-11-24 14:27:08 -0500

CatherineH gravatar image

Is it possible to get catkin build to run pip install -r requirements.txt?

Some of the python package dependencies for my package are in version control systems, and because of this I think I need to use pip to install them instead of putting them in setup.py.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2015-11-24 19:26:18 -0500

William gravatar image

Conceptually this is not quite right. rosdep is the tool which should be used to install dependencies. You can add rosdep rules which resolve to pip installations (including directly from version control). You can have these rules locally or propose them for the rosdep database ( https://github.com/ros/rosdistro/tree... ).

You should run rosdep once to satisfy dependencies and then the build (catkin_make, catkin_make_isolated, or catkin build) should be called many times and therefore it shouldn't do any dependency resolution as part of the build.

edit flag offensive delete link more
2

answered 2015-11-25 08:51:30 -0500

CatherineH gravatar image

As William's answer states, rosdep is the way to go.

For example, I can replicate the call to pip by first creating a rosdep.yaml file in my directory with the contents:

pip-seaborn:
 ubuntu:
  pip:
    packages: [seaborn]
pip-vikit-py:
 ubuntu:
  pip:
    packages: [vikit-py]
    alt_install_cmd: git+git://github.com/CatherineH/rpg_vikit.git#egg=vikit_py&subdirectory=vikit_py

Then, I modify my package.xml file to include:

<run_depend>pip-seaborn</run_depend>
<run_depend>pip-vikit-py</run_depend>

Then, I created the file /etc/ros/rosdep/sources.list.d/40-my-list.list, which contains the line:

yaml file:///my-package-path/rosdep.yaml

Finally, I run:

rosdep update
rosdep install --from-path my-package-path
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-11-24 14:27:08 -0500

Seen: 2,238 times

Last updated: Nov 25 '15