0
$\begingroup$

Rosanswers logo

I have this error in the Jenkins doc job of my package: http://build.ros.org/view/Mdoc/job/Mdoc__z_laser_projector__ubuntu_bionic_amd64/2/console

04:09:39 /tmp/ws/src/z_laser_projector/doc/zlp_core.rst:4: WARNING: autodoc: failed to import module u'zlp_core'; the following exception was raised:
04:09:39 Traceback (most recent call last):
04:09:39   File "/usr/lib/python2.7/dist-packages/sphinx/ext/autodoc.py", line 658, in import_object
04:09:39     __import__(self.modname)
04:09:39   File "/tmp/ws/src/z_laser_projector/src/z_laser_projector/zlp_core.py", line 29, in <module>
04:09:39     import thriftpy
04:09:39 ImportError: No module named thriftpy

I'm trying to solve it including dependencies in my package.xml:

  <build_depend>python3-thriftpy</build_depend>
  <build_export_depend>python3-thriftpy</build_export_depend>
  <exec_depend>python3-thriftpy</exec_depend>

However, when I try to build the package at Travis-CI (in private before try in Jenkins), it throws this error:

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
z_laser_projector: Cannot locate rosdep definition for [python3-thriftpy]
The command "rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO" failed and exited with 1 during .

How could I include this dependency in order to fix the Jenkins job? Am I taking the right way to solve the error?


Originally posted by rluque on ROS Answers with karma: 20 on 2020-11-24

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Package.xml dependencies are resolved with rosdep. In order to be resolvable with the default sources, rosdep definitions need to be added. You can read about contributing those here: https://github.com/ros/rosdistro/blob/master/CONTRIBUTING.md#rosdep-rules-contributions


Originally posted by nuclearsandwich with karma: 906 on 2020-11-24

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by gvdhoorn on 2020-11-25:
Just to add to this: package.xml does not use the name of a Python package or the name of a Debian version of that Python package directly.

All names in package manifests are actually keys, which get looked up in a database (called the rosdep DB). The result of that mapping is then used to check for presence of and to install a package.

So if python3-thriftpy is not already registered in the rosdep DB, you can add the name to your manifest, but that won't help. rosdep will still not be able to "understand" it. That's what

Cannot locate rosdep definition for [python3-thriftpy]

means.

This may seem rather convoluted, but there are good reasons for this system. See #q215059 for a Q&A which discusses this.

Comment by rluque on 2020-12-22:
Thank you very much for your help! I asked for adding python3-thriftpy depend at rosdep. See here: https://github.com/ros/rosdistro/pull/27582

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.