0
$\begingroup$

Rosanswers logo

Hello,

I am atempting to build ROS2 from source to include messages from vision_msgs package in ros bridge. I am following the instructions here. Everything goes well up until the section where I am supposed to use rosdep. I get an error:

    user@comp:~/Workspace/ros2_eloquent$ sudo rosdep init
Traceback (most recent call last):
  File "/usr/bin/rosdep", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/home/hrrnxt/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3112, in <module>
    @_call_aside
  File "/home/hrrnxt/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3096, in _call_aside
    f(*args, **kwargs)
  File "/home/hrrnxt/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3125, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/home/hrrnxt/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 580, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/home/hrrnxt/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 593, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/home/hrrnxt/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 781, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'rosdistro>=0.7.5' distribution was not found and is required by rosdep

Am I supposed to source a ROS workspace to be able to build from source? My output from "env | grep ROS" is empty.

Running on Ubuntu 18.04.4 LTS, x64


Originally posted by Narton on ROS Answers with karma: 83 on 2020-04-07

Post score: 0


Original comments

Comment by gvdhoorn on 2020-04-08:
One thing I notice is that ROS 2 is exclusively Python 3. The traceback you show includes a lot of python2.7 paths. That may be what is going wrong here.

Have you at any point installed any ROS Python packages using pip? That's typically how they end up in your $HOME directory.

You'll want to try removing those and then see whether things work.

Am I supposed to source a ROS workspace to be able to build from source?

No, but your Python interpreter must have access to the required (versions of) the necessary packages. It looks like your current setup is making that impossible.

Comment by Narton on 2020-04-08:
Good point. I uninstalled a lot of ros stuff from both python2 and python3 using pip, then apt removed ros-*. Reinstalled ros-melodic, and then had to 'pip2 install catkin_pkg' before rosdep would work with the melodic install... so I have gotten past the error. I think it is possible the confusion came from me thinking pip pointed to python2 while it points to python3.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I ended up cleaning out the python2 and python3 environments of ros stuff, reinstalling ros-melodic, then had to 'pip2 install catkin_pkg' before rosdep worked with melodic. Rosdep then worked for setting up the dependencies for eloquent.


Originally posted by Narton with karma: 83 on 2020-04-08

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by aleena_infinitynbeyond on 2021-09-22:
How did you clean out the python2 and python3 environments of ros stuff?

$\endgroup$

Your Answer

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