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

Rosdep Import error

asked 2019-05-30 11:59:08 -0600

elementaryshr gravatar image

updated 2019-05-30 12:52:13 -0600


I am trying to install a ros package on ubuntu 16.04 and ros kinetic version. However, the rosdep init seems to give following error:

Traceback (most recent call last):
  File "/usr/bin/rosdep", line 3, in <module>
    from rosdep2.main import rosdep_main
  File "/usr/lib/python2.7/dist-packages/rosdep2/", line 45, in <module>
    from .lookup import RosdepDefinition, RosdepView, RosdepLookup, \
  File "/usr/lib/python2.7/dist-packages/rosdep2/", line 44, in <module>
    from .sources_list import SourcesListLoader
  File "/usr/lib/python2.7/dist-packages/rosdep2/", line 49, in <module>
    from .gbpdistro_support import get_gbprepo_as_rosdep_data, download_gbpdistro_as_rosdep_data
  File "/usr/lib/python2.7/dist-packages/rosdep2/", line 18, in <module>
    from .platforms.debian import APT_INSTALLER
  File "/usr/lib/python2.7/dist-packages/rosdep2/platforms/", line 34, in <module>
    from rospkg.os_detect import OS_DEBIAN, OS_LINARO, OS_UBUNTU, OS_ELEMENTARY, OS_MX, OsDetect, read_os_release
ImportError: cannot import name OS_MX

This seems some python issue, but I have tried reinstalling: rosdep, ros kinetic, python and even did a reset of bashrc. If I remove the OS_MX, some OS_EMBEDDDED gives import error.

Rospkg version is 1.1.9

What could be the case here?

edit retag flag offensive close merge delete


A guess, but seeing as you're on Ubuntu 14.04: it could be that rospkg is not up-to-date enough on your system. Causing rosdep to fail when it tries to import symbols that should be part of rospkg but aren't on your system.

gvdhoorn gravatar image gvdhoorn  ( 2019-05-30 12:13:26 -0600 )edit

Thanks @gvdhoorn,

The rospkg is also up to date (V 1.19)

elementaryshr gravatar image elementaryshr  ( 2019-05-30 12:23:42 -0600 )edit

Did you mean to write 1.1.9?

gvdhoorn gravatar image gvdhoorn  ( 2019-05-30 12:46:22 -0600 )edit

Just noticed this:

ubuntu 14.04 and ros kinetic version

Kinetic is not supported on Ubuntu 14.04; are you building things from source or is this a typo?

gvdhoorn gravatar image gvdhoorn  ( 2019-05-30 12:47:08 -0600 )edit

I am extreamly sorry, I typed out both the things rather quickly.

The Ubuntu version is 16.04.6 The rospkg is also 1.1.9

I have installed it via package manager.

elementaryshr gravatar image elementaryshr  ( 2019-05-30 12:51:28 -0600 )edit

Have you tried upgrading packages: sudo apt update && sudo apt upgrade before installing?

Orhan gravatar image Orhan  ( 2019-05-31 02:43:51 -0600 )edit

Yes indeed. All the packages are up to date

elementaryshr gravatar image elementaryshr  ( 2019-05-31 03:06:09 -0600 )edit

Have you solved the problem? I meet this problem too today.

Sensenzhl gravatar image Sensenzhl  ( 2021-12-24 08:59:39 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2019-05-31 09:21:22 -0600

elementaryshr gravatar image

Solved the issue by updating pip2. Apparently I had 3 pip installations pip (this should be pip2), pip2, pip3.

edit flag offensive delete link more


This didn't solve it for me on one of my machines, but for completeness: sudo -H pip2 install --upgrade pip

fvd gravatar image fvd  ( 2020-03-23 02:48:14 -0600 )edit

answered 2020-03-23 03:07:57 -0600

fvd gravatar image

updated 2020-03-23 03:08:32 -0600

I had to upgrade rospkg by running pip install --upgrade rospkg to solve this. Apparently OS_MX was introduced in version 1.1.8.

I also ran sudo apt update && sudo apt upgrade, but I think updating rospkg is what actually solved it.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-05-30 11:59:08 -0600

Seen: 2,218 times

Last updated: Mar 23 '20