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

catkin build in Ubuntu 20.04 noetic?

asked 2020-05-24 10:41:19 -0500

lucasw gravatar image

updated 2020-11-21 11:22:15 -0500

I think the answer is in an issue linked below, and that catkin tools isn't ready for noetic yet, and I'll have to test and upgrade my packages using catkin_make.

sudo apt install python3-catkin-tools
...
The following packages have unmet dependencies:
 python3-catkin-tools : Depends: python3-trollius but it is not installable

Then:

sudo apt install python3-trollius
...
E: Package 'python3-trollius' has no installation candidate

Try pip instead:

sudo pip3 install -U catkin_tools
Collecting catkin_tools
  Downloading catkin_tools-0.4.5-py3-none-any.whl (379 kB)
     |████████████████████████████████| 379 kB 4.4 MB/s 
Requirement already satisfied, skipping upgrade: setuptools in /usr/lib/python3/dist-packages (from catkin_tools) (45.2.0)
Collecting osrf-pycommon>0.1.1
  Downloading osrf_pycommon-0.1.9-py3-none-any.whl (38 kB)
Collecting trollius
  Downloading trollius-2.1.post2.tar.gz (274 kB)
 |████████████████████████████████| 274 kB 24.9 MB/s 
Requirement already satisfied, skipping upgrade: catkin-pkg>0.2.9 in /usr/lib/python3/dist-packages (from catkin_tools) (0.4.20)
Requirement already satisfied, skipping upgrade: PyYAML in /usr/lib/python3/dist-packages (from catkin_tools) (5.3.1)
Requirement already satisfied, skipping upgrade: six in /usr/lib/python3/dist-packages (from trollius->catkin_tools) (1.14.0)
Building wheels for collected packages: trollius
  Building wheel for trollius (setup.py) ... done
  Created wheel for trollius: filename=trollius-2.1.post2-py3-none-any.whl size=122060 sha256=c84ada60b3e737fefbf018b65fc9889526a61e9d1fe663c76b1ebdeaed9adc45
  Stored in directory: /root/.cache/pip/wheels/f4/64/34/347c23c361a3e52dd29b82cbe7ca542769f85d9b7aef4f764c
Successfully built trollius

Installing collected packages: osrf-pycommon, trollius, catkin-tools
Successfully installed catkin-tools-0.4.5 osrf-pycommon-0.1.9 trollius-2.1.post2

The github issue mentions trollius should be replaced by asyncio, so seeing trollius above isn't encouraging.

~/catkin_ws$ catkin build
Traceback (most recent call last):
  File "/usr/local/bin/catkin", line 5, in <module>
    from catkin_tools.commands.catkin import main
  File "/usr/local/lib/python3.8/dist-packages/catkin_tools/commands/catkin.py", line 28, in <module>
    from catkin_tools.common import is_tty
  File "/usr/local/lib/python3.8/dist-packages/catkin_tools/common.py", line 23, in <module>
    import trollius as asyncio
  File "/usr/local/lib/python3.8/dist-packages/trollius/__init__.py", line 21, in <module>
    from .base_events import *
  File "/usr/local/lib/python3.8/dist-packages/trollius/base_events.py", line 42, in <module>
    from . import tasks
  File "/usr/local/lib/python3.8/dist-packages/trollius/tasks.py", line 565
    def async(coro_or_future, loop=None):
        ^
SyntaxError: invalid syntax

That leads to: https://github.com/catkin/catkin_tool... , then to https://github.com/catkin/catkin_tool...

edit retag flag offensive close merge delete

Comments

Then what I recommend in my comment should work for you as well.

I'll convert it to an answer.

gvdhoorn gravatar image gvdhoorn  ( 2020-05-24 13:39:15 -0500 )edit

1 Answer

Sort by » oldest newest most voted
15

answered 2020-05-24 11:28:49 -0500

gvdhoorn gravatar image

updated 2020-12-25 07:31:03 -0500

Edit: as of 2020-12-25, it may be easier to make sure you have the ROS package repositories configured (the same ones you use to install ROS itself), and then:

sudo apt install python3-catkin-tools python3-osrf-pycommon

The osrf-pycommon package is a dependency, but not in the Debian control file, hence it doesn't get installed automatically.

Note: this is still a work-around of sorts, as the main problem has not been addressed yet.


Original answer: are you trying to do this on Ubuntu Focal or Bionic? If you "only" have Python 3, then I believe catkin/catkin_tools#597 should not matter: on Focal, catkin_tools would be running using Python 3, so that would be the same interpreter as it should use in the workspace itself. The issue describes a situation where there is a difference between the interpreter running catkin_tools vs the interpreter used in the workspace.

As to Trollius: there just hasn't been a release yet of catkin_tools with the PRs integrated which remove the dependency.

I'd suggest to try and install catkin_tools using pip, but from the repository (so not a released version):

pip3 install --user git+https://github.com/catkin/catkin_tools.git

This works for me.

Note: be sure to remove this work-around after a new release of catkin_tools has been cut. Otherwise you will run into issues later.

edit flag offensive delete link more

Comments

It's 20.04 focal (updated title)

lucasw gravatar image lucasw  ( 2020-05-24 12:41:09 -0500 )edit
2

It looks like the pip github install is no longer needed

pip3 uninstall catkin_tools
sudo apt install python3-catkin-tools
catkin build
lucasw gravatar image lucasw  ( 2020-06-06 09:48:58 -0500 )edit

This was recently fixed with the release of 0.7.0 afaik.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-06 09:52:59 -0500 )edit
1

Looks like, as of today, there is still work going on to get 0.7.0 fully working in python3 IF you would like to install with sudo apt install python3-catkin-tools. That is, I am experiencing 'osrf-pycommon>0.1.1' distribution was not found if I install with sudo apt install python3-catkin-tools and try to run any catkincommands. See https://github.com/catkin/catkin_tool...

So as of today, seems working solution is still:

pip3 install --user git+https://github.com/catkin/catkin_tools.git

viktor.holova gravatar image viktor.holova  ( 2020-06-16 11:17:20 -0500 )edit
4

this worked for me: sudo apt-get install python3-osrf-pycommon python3-catkin-toolscredits: based on mintar comment on : https://github.com/catkin/catkin_tool...

Oscar Lima gravatar image Oscar Lima  ( 2020-10-23 10:12:39 -0500 )edit

Thanks, this worked for me pip3 install --user git+https://github.com/catkin/catkin_... in ROS Noetic

aleena_infinitynbeyond gravatar image aleena_infinitynbeyond  ( 2020-12-25 02:31:08 -0500 )edit
1

Thanks, catkin build works for me after sudo apt install python3-catkin-tools python3-osrf-pycommon in ROS Noetic with Ubuntu 20.04

OrnellaT gravatar image OrnellaT  ( 2021-03-29 04:50:46 -0500 )edit

I installed catkin-tools with sudo apt install python3-catkin-tools python3-osrf-pycommon and after that catkin build works fine for me. When I do source devel/setup.bash my workspace is not added to ROS_PACKAGE_PATH, while if a I do the same with a workspace build through catkin_make everything it work fine. Does someone had the same issue?

enricovilla gravatar image enricovilla  ( 2021-06-22 02:41:21 -0500 )edit

Question Tools

4 followers

Stats

Asked: 2020-05-24 10:41:19 -0500

Seen: 27,129 times

Last updated: Dec 25 '20