Running a prerelease test fails with Python ImportError
Hey everyone,
I am currently trying on publishing a ROS package and following the Realeasing A Package guide. So far I've added my package name to the rosdistro for kinetic and verified its readiness before. Unfortunately, I can't manage to execute a prerelease test. I get stuck at the 4th step of section 5.2. When I run the generated command (which is shown below), I get the following error:
The command:
mkdir -p /tmp/prerelease_job
cd /tmp/prerelease_job
generate_prerelease_script.py \
https://raw.githubusercontent.com/ros-infrastructure/ros_buildfarm_config/production/index.yaml \
kinetic default ubuntu xenial amd64 \
robot_statemachine \
--level 1 \
--output-dir ./
The error output:
Traceback (most recent call last):
File "/usr/bin/generate_prerelease_script.py", line 35, in <module>
from ros_buildfarm.config import get_index as get_config_index
File "/usr/lib/python3/dist-packages/ros_buildfarm/config/__init__.py", line 20, in <module>
import yaml
File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 2, in <module>
from error import *
ImportError: No module named 'error'
So far, I've tried with the first suggestion under 5.1, installing the python3-ros-buildfarm
which produced the above error. Then I removed it, and installed python-ros-buildfarm
, also installing the dependencies required in the second purple box under section 5.1. With this the prerelease script could be built but it produced the following error when I ran it:
prerelease.sh output with python-ros-buildfarm:
Prerelease script
By default this script will continue even if tests fail.
If you want the script to abort and return a non-zero return code
you can set the environment variable ABORT_ON_TEST_FAILURE=1.
You can also set ABORT_ON_TEST_FAILURE_UNDERLAY=1 or
ABORT_ON_TEST_FAILURE_OVERLAY=1 to only affect a specific workspace.
Use workspace: /tmp/prerelease_job
Clone source repositories for underlay workspace
+ git clone --recurse-submodules -b master https://github.com/MarcoStb1993/robot_statemachine.git ws/src/robot_statemachine
Cloning into 'ws/src/robot_statemachine'...
remote: Enumerating objects: 63, done.
remote: Counting objects: 100% (63/63), done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 936 (delta 31), reused 37 (delta 19), pack-reused 873
Receiving objects: 100% (936/936), 1.90 MiB | 587.00 KiB/s, done.
Resolving deltas: 100% (627/627), done.
Checking connectivity... done.
+ git -C ws/src/robot_statemachine --no-pager log -n 1
commit 6217fdb14c265dbf85b4688b730f8514caf30efa
Author: MarcoStb1993 <35468630+MarcoStb1993@users.noreply.github.com>
Date: Thu Aug 1 12:05:33 2019 +0200
Delete .project
Clone release repositories for overlay workspace
Underlay workspace contains 6 packages:
- robot_statemachine
- statemachine
- statemachine_additions
- statemachine_msgs
- statemachine_rqt_plugins
- statemachine_rviz_plugins
Overlay packages based on dependency level: 0
Overlay packages based on whitelisted package names: 0
Overlay workspace will contain 0 packages:
Traceback (most recent call last):
File "/usr/bin/vcs", line 11, in <module>
load_entry_point('vcstool==0.2.2', 'console_scripts', 'vcs')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 542, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2229, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources ...
off-topic, but: is your package really called
statemachine
? That is a really generic name and I'm surprised your ros/rosdistro#21873 was merged.I can only make the suggestion that you rename your packages to something more descriptive and unique. Refer to REP 144: ROS Package Naming for some rationale on why using descriptive names is much preferred over using generic ones.
As to the error message: you appear to be mixing Python 2.7 and Python 3 modules and interpreters.
What is the output of
which python
,which python3
andpython --version
?Hm, yes, now that you say it ... It is bundled in a metapackage called
robot_statemachine
though, if that makes it any better.I supsected this to be the case, but I was not able to fix it on my own. Here are the outputs:
which python
:/usr/bin/python
which python3
:/usr/bin/python3
python --version
:Python 2.7.12
python3 --version
:Python 3.5.2
Added them to the post as well.
Not really.
Metapackages don't "bundle" other packages. They merely provide convenience.
I've written something about them in #q256493.