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

Unable to build catkin workspace; python-rosdep, no module terminal_color

asked 2018-09-22 08:20:55 -0500

AndreKissling gravatar image

updated 2018-09-24 08:06:25 -0500

Hi guys,

I'm running into an error when installing ROS (melodic) on Ubuntu (18.04). As I have absolutely no experience with UNIX, I don't really know what's going on or how to fix it.

First, I tried installing it with sudo apt-get install ros-melodic-desktop-full but that didn't work because it wasn't found. Following the suggestion of an online post, I switched to installing it from source.

AddOn: Sorry that I haven't mentioned that in advance (didn't make the connection): I'm running Ubuntu on the Windows Subsystem for Linux (WSL) and I already have Python3 installed on windows. Ref. comment in this ROS Answer. How can I check whether this is the problem?

Now I'm following these instructions: melodic installation from source

Everything worked up to point 2.1.1 Resolving Dependencies. Doing this step (again), I get the info:

~/ros_catkin_ws$ rosdep install --from-paths src --ignore-src --rosdistro melodic -y
executing command [sudo -H apt-get install -y python-rosdep]
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'python-rosdep2' instead of 'python-rosdep'
python-rosdep2 is already the newest version (0.11.8-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
ERROR: the following rosdeps failed to install
  apt: Failed to detect successful installation of [python-rosdep]

Then I proceed with the installation tutorial trying to build the catkin workspace:

~/ros_catkin_ws$ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
Traceback (most recent call last):
  File "./src/catkin/bin/catkin_make_isolated", line 12, in <module>
    from catkin.builder import build_workspace_isolated
  File "./src/catkin/bin/../python/catkin/builder.py", line 66, in <module>
    from catkin_pkg.terminal_color import ansi, disable_ANSI_colors, fmt, sanitize
ImportError: No module named terminal_color

This is my Ubuntu release:

~/ros_catkin_ws$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04

According to the answer from 130s I tried the command sudo apt-get update, but that didn't work initially due to a key not being available:

$ sudo apt-get update
[sudo] password for stivari:
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://packages.ros.org/ros/ubuntu bionic InRelease [4031 B]
Err:5 http://packages.ros.org/ros/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5523BAEEB01FA116
Reading package lists... Done
W: GPG error: http://packages.ros.org/ros/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5523BAEEB01FA116
E: The repository 'http://packages.ros.org/ros/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Adding ... (more)

edit retag flag offensive close merge delete

Comments

Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)

When you see something like this you need to run the commands in admin mode. Add sudo in the beginning of the command (that's Linux basics so you can find lots of info by Googling the error message ;)

130s gravatar image 130s  ( 2018-09-23 19:33:43 -0500 )edit
1

I'm following these instructions: melodic installation from source

First question: why do you want to install Melodic from sources on Ubuntu 18, for which binary packages are available (ie: simple apt install ros-melodic-****)?

gvdhoorn gravatar image gvdhoorn  ( 2018-09-24 02:10:25 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2018-09-24 09:50:12 -0500

gvdhoorn gravatar image

updated 2018-09-24 09:51:18 -0500

First, I tried installing it with sudo apt-get install ros-melodic-desktop-full but that didn't work because it wasn't found. Following the suggestion of an online post, I switched to installing it from source.

I would strongly recommend to not install from sources. Especially not under WSL. It's very slow, and you'll spend way too much time managing your installation.

A binary installation is almost always preferred over building things from sources.

desktop_full has been released into Melodic (see status_page/ros_melodic_default.html?q=full fi), so if you couldn't install that, I'm wondering whether you setup your system correctly.

Please figure out whether you have a need for installing ROS from sources, and if you don't, I would revert whatever you already have done and we should try to figure out why sudo apt install ros-melodic-desktop-full didn't work for you, not start a source install and diagnosing problems with that.


Edit: just noticed this:

I tried the command sudo apt-get update, but that didn't work initially due to a key not being available

If the key also wasn't available the first time you tried sudo apt-get install ros-melodic-desktop-full, then that was the reason why apt couldn't find the package.

edit flag offensive delete link more

Comments

After adding the key manually it was possible to install it using apt-get install. Thanks!

AndreKissling gravatar image AndreKissling  ( 2018-09-27 13:09:10 -0500 )edit
0

answered 2018-09-22 12:41:06 -0500

130s gravatar image

updated 2018-09-22 15:20:12 -0500

Try apt-get update then run the same rosdep.

I can't find previous threads etc. though, the following error messages indicate that an apt-get command with valid arguments was executed but somehow the package wasn't installed.

executing command [sudo -H apt-get install -y python-rosdep]
:
apt: Failed to detect successful installation of

I confirmed that this can happen when there's no local apt repositories. An example steps to reproduce (didn't try with exactly the same package and command though, this looks promising to me):

$ docker images | grep -i melodic
ros                                                                melodic                                         9ca8b5b3f443        2 weeks ago         1.21GB
$ docker run -it ros:melodic
root@ab6930559935:/# rm /var/lib/apt/lists/*
rm: cannot remove '/var/lib/apt/lists/*': No such file or directory

root@ab6930559935:/# apt-get install -y python-mock
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-mock

root@ab6930559935:/# apt-get update

root@ab6930559935:/# apt-get install -y python-mock
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  python-funcsigs python-pbr
Suggested packages:
  python-funcsigs-doc python-mock-doc
The following NEW packages will be installed:
  python-funcsigs python-mock python-pbr
Setting up python-mock (2.0.0-3) ...

root@ab6930559935:/# apt-get purge python-mock
:
The following packages were automatically installed and are no longer required:
    python-funcsigs python-pbr
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  python-mock*
  0 upgraded, 0 newly installed, 1 to remove and 61 not upgraded.
  After this operation, 288 kB disk space will be freed.
  Do you want to continue? [Y/n]
  (Reading database ... 66410 files and directories currently installed.)
  Removing python-mock (2.0.0-3) ...

root@ab6930559935:/# rm -fr /var/lib/apt/lists/*

root@ab6930559935:/# apt-get install -y python-mock
:
E: Unable to locate package python-mock
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-09-22 08:18:12 -0500

Seen: 2,373 times

Last updated: Sep 24 '18