felixduvallet / ros-travis-integration

ROS package continuous integration using travis-CI
BSD 3-Clause "New" or "Revised" License
127 stars 45 forks source link

travis build is failing #9

Closed felixduvallet closed 7 years ago

felixduvallet commented 7 years ago

As of the latest travis image update, this script is no longer working. (I'm looking into it, but please post any ideas you might have)

felixduvallet commented 7 years ago

The Travis build fails due to a python import error:

ImportError: "from catkin_pkg.package import parse_package" failed
No module named catkin_pkg.package

The root cause is that Travis upgraded their trusty images (specifically from connie-trusty to sugilite-trusty, see here), which put the python binary into /opt/python/2.7.13 (and the python search path was updated accordingly).

However, since all ROS dependencies are installed by apt-get into /usr/lib/python2.7 (which is not in the python system path), any python-related ROS calls failed (including building).

The fix (see #10 ) is to manually add /usr/lib/python2.7 into the PYTHONPATH environment variable to ensure that python is able to find all required packages once they are installed via apt-get.

Note that this isn't exactly the Travis-recommended way of installing python packages (they recommend using pip instead of apt-get), but this method is compatible with the ROS dependency management.