rosdep init return pkg_resources.DistributionNotFound

asked 2021-02-04 20:16:38 -0500

vitsensei gravatar image

updated 2021-02-04 20:22:29 -0500

Hi all,

I just install ROS the first time today (melodic on Ubuntu 18.04). I installed rosdep without any problem using the following command:

sudo apt install python-rosdep

Not sure what went wrong during the process but as soon as I run sudo rosdep init, I received the following errror:

Traceback (most recent call last):

File "/usr/bin/rosdep", line 6, in <module> from pkg_resources import load_entry_point

File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3088, in <module> @_call_aside

File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3072, in _call_aside f(args, *kwargs) File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3101, in _initialize_master_working_set working_set = WorkingSet._build_master() File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 574, in _build_master ws.require(__requires__)

File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 892, in require needed = self.resolve(parse_requirements(requirements))

File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 778, in resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'rosdep==0.20.0' distribution was not found and is required by the application

What I'm confused about is how come rosdep is installed using python2 version, my traceback is showing the rosdep command is using version 3.

Any ideas?

edit retag flag offensive close merge delete

Comments

Please edit your question to clarify what you did to "install ROS" The first thing that jumps out to me from your backtrace is that you appear to be using python3 however python2 is the default for melodic. What are your apt sources? To best help you we need enough information to reproduce your problem.

tfoote gravatar image tfoote  ( 2021-02-05 14:25:53 -0500 )edit