Robotics StackExchange | Archived questions

rosdep init return pkg_resources.DistributionNotFound

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 from pkgresources import loadentry_point

File "/usr/lib/python3/dist-packages/pkgresources/init.py", line 3088, in @call_aside

File "/usr/lib/python3/dist-packages/pkgresources/init.py", line 3072, in _callaside f(args, *kwargs) File "/usr/lib/python3/dist-packages/pkgresources/init.py", line 3101, in _initializemasterworkingset workingset = WorkingSet.buildmaster() File "/usr/lib/python3/dist-packages/pkgresources/init.py", line 574, in buildmaster ws.require(requires)

File "/usr/lib/python3/dist-packages/pkgresources/init.py", line 892, in require needed = self.resolve(parserequirements(requirements))

File "/usr/lib/python3/dist-packages/pkgresources/init.py", line 778, in resolve raise DistributionNotFound(req, requirers) pkgresources.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?

Asked by vitsensei on 2021-02-04 21:16:38 UTC

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.

Asked by tfoote on 2021-02-05 15:25:53 UTC

Answers