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

How can I use other python package in releasing environment

asked 2013-10-02 07:21:15 -0600

updated 2013-10-18 21:39:00 -0600

I want to run a script that uses already release python package (genrb) from cmake. Though in normal catkin environment it has no problem, when releasing as debian package it fails.

I write below in CMakeLists and this works fine in normal catkin environment.(this is a part of macro)


in, it imports genrb package like

from genrb.generator import msg_generator

and that line fails in relese jenkins environment. the result is here.

(also local prerelease test fails)

How can we do like this?

  • use python package that is already released
    • in releasing environment
    • from cmake macro
    • the package (genrb) is in package.xml (build_depend and run_depend)
    • I'm using bloom to release

This is the code that I want to release.


${CATKIN_ENV} did not solve my problem. Prerelease test failed in my local environment.

CATKIN_ENV (that means catkin_generated/ -> adds PYTHONPATH like below.

export PYTHONPATH="/tmp/tmp0r5SRD/obj-x86_64-linux-gnu/devel/lib/python2.7/dist-packages:$PYTHONPATH"

but python libraries installed by binary is not there. that is place for source installed libraries. We need /opt/ros/hydro/lib/python2.7/dist-packages in order to use binary(debian) installed ros python library. Is this correct?

I used below cmake script. This fails in local prerelease test.



This does not happened in build farm prerelease test. Is it a problem of my local test?

edit retag flag offensive close merge delete


It seems that binary install environment does not support ROS environmental variables. So if we want to use it, we have to source /opt/ros/hydro/ in shell script, then call the python script.

ogutti gravatar image ogutti  ( 2013-10-04 18:49:17 -0600 )edit

Before invoking CMake you have to make sure that all system stuff you want to use is in the environment. The env script will only take care of the catkin specific environment extension.

Dirk Thomas gravatar image Dirk Thomas  ( 2013-10-09 07:34:04 -0600 )edit

Local pre-release test failed, but build farm test seems success! It seems better to use prerelease site. (I always used local prerelease test) Anyway, thank you very much for your support.

ogutti gravatar image ogutti  ( 2013-10-18 21:37:17 -0600 )edit

The wiki for local pre-release has just recently been edited as to recommend the one on buildfarm (triggered by this discussion

130s gravatar image 130s  ( 2013-10-19 05:35:46 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-10-05 08:25:38 -0600

Dirk Thomas gravatar image

In order to use the correct environment during the build process you need to prefix your command with the ${CATKIN_ENV} variable. It uses the generated script which will source the file before calling the command passed in as an argument.

There is a short description about that in the catkin docs:

You can also take a look at some code which makes use of that to invoke external commands:

edit flag offensive delete link more


Thanks! That is what i'm searching!

ogutti gravatar image ogutti  ( 2013-10-08 05:32:33 -0600 )edit

Question Tools

1 follower


Asked: 2013-10-02 07:21:15 -0600

Seen: 299 times

Last updated: Oct 18 '13