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

Buildfarm Jenkins devel job unstable

asked 2020-12-23 06:06:17 -0500

rluque gravatar image

I'm trying to fix Jenkins devel job of the package z_laser_projector

I'm having some import errors when running tests ("1.3. run tests" Console Section)

ModuleNotFoundError: No module named 'rospkg'

The whole package is developed for python3 in ROS melodic but Jenkins is using python2. I would like to ask if there is any way to force Jenkins configuration in order to run catkin with python3, for example forcing env vars as ROS_PYTHON_VERSION. Or am I missing something on package.xml?

Check that the build succeeds by running tests on TravisCI

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2020-12-23 13:06:21 -0500

gvdhoorn gravatar image

updated 2020-12-23 14:17:11 -0500

The whole package is developed for python3 in ROS melodic [..]

ROS Melodic is Python 2 based. All packages released through the ROS buildfarm will therefore only get to use Python 2.

but Jenkins is using python2. [..] is there any way to force Jenkins configuration in order to run catkin with python3, for example forcing env vars as ROS_PYTHON_VERSION.

This is not a limitation of the ROS buildfarm, but of ROS Melodic (see also REP 3: Melodic Morenia).

Or am I missing something on package.xml?

No. The reason this is not working is because you cannot release a Python 3 package into ROS Melodic.

Or at least, not without some tricks (such as catkin_virtualenv).

For native Python 3 support, you'll have to switch to ROS Noetic (and/r ROS 2).

Check that the build succeeds by running tests on TravisCI

Yes, probably because you invoke the build of your workspace like this:

catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_VERSION=3.6 --force-cmake

which forces the use of Python 3 in a ROS Melodic workspace (ie: a Python 2-based ROS distro).

edit flag offensive delete link more

Comments

Thank you very much for your answer, it has been very helpful!

rluque gravatar image rluque  ( 2021-01-11 07:32:01 -0500 )edit
1

answered 2020-12-23 13:06:16 -0500

nuclearsandwich gravatar image

Melodic is configured as a Python 2 distribution. The default source-build configuration also uses Python 2 and changing that for a single package wouldn't work. You would need to add a separate binary distribution of Melodic using Python 3.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-12-23 06:06:17 -0500

Seen: 135 times

Last updated: Dec 23 '20