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

Building Ros Melodic from source fails at vcs import src < melodic-desktop-full.rosinstall

asked 2023-01-06 03:09:33 -0500

xdzye gravatar image

I decided to build ROS Melodic from source instead and deleted all ROS Melodic packages and installation binaries.

I've been following these steps: wiki.ros.org/melodic/Installation/Source

Unfortunately it fails at vcs import src < melodic-desktop-full.rosinstall with

Traceback (most recent call last):
  File "/usr/local/bin/vcs", line 7, in <module>
    from vcstool.commands.vcs import main
  File "/usr/local/lib/python2.7/dist-packages/vcstool/commands/__init__.py", line 1, in <module>
    from .branch import BranchCommand
  File "/usr/local/lib/python2.7/dist-packages/vcstool/commands/branch.py", line 6, in <module>
    from .command import Command
  File "/usr/local/lib/python2.7/dist-packages/vcstool/commands/command.py", line 6, in <module>
    from vcstool.executor import execute_jobs
  File "/usr/local/lib/python2.7/dist-packages/vcstool/executor.py", line 31
    file=stdout)
        ^
SyntaxError: invalid syntax

What can I do to fix this problem? I found nothing while searching for this.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-01-06 04:32:03 -0500

gvdhoorn gravatar image

In short: you're using Python 2, which the main distribution(s) of vcstool no longer support.

You'll either have to use Python 3 to run vcstool, or switch to the 0.2.x branch.

I'd suggest the former.

Note this is mentioned in the readme of vcstool:

Python 2.7 / <= 3.4 support

The latest version supporting Python 2.7 and Python <= 3.4 is 0.2.x from the 0.2.x branch.

edit flag offensive delete link more

Comments

Ok, thank you very much! I thought melodic is better to run with Python 2.7, or should i rebuild with Python3?

I saw this thread: https://answers.ros.org/question/2376... and also your answer that suggests one can use basic functionality when building with python3, but I need opencv etc. to use rtabmap. Should I just stick to 2.7?

I also found a gist that suggests another installation path for ros melodic with python3: https://gist.github.com/MBaranPeker/3... I dont really understand the sed commands in the gist so I cant judge if this would build all packages with Python3.

xdzye gravatar image xdzye  ( 2023-01-06 15:17:46 -0500 )edit

It's perfectly possible to use Python 3 for vcstool while using Python 2 for Melodic.

There is no need to build Melodic from source, nor for Python 3.

gvdhoorn gravatar image gvdhoorn  ( 2023-01-08 03:22:12 -0500 )edit

Thank you, I got it working.

xdzye gravatar image xdzye  ( 2023-01-18 08:41:41 -0500 )edit

Question Tools

Stats

Asked: 2023-01-06 02:49:35 -0500

Seen: 334 times

Last updated: Jan 06 '23