Ask Your Question
0

Rosdep Import error

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

elementaryshr gravatar image

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

Hi,

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/__init__.py", line 45, in <module>
    from .lookup import RosdepDefinition, RosdepView, RosdepLookup, \
  File "/usr/lib/python2.7/dist-packages/rosdep2/lookup.py", line 44, in <module>
    from .sources_list import SourcesListLoader
  File "/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py", 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/gbpdistro_support.py", line 18, in <module>
    from .platforms.debian import APT_INSTALLER
  File "/usr/lib/python2.7/dist-packages/rosdep2/platforms/debian.py", 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

Comments

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 -0500 )edit

Thanks @gvdhoorn,

The rospkg is also up to date (V 1.19)

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

Did you mean to write 1.1.9?

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

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 -0500 )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 -0500 )edit

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

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

Yes indeed. All the packages are up to date

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

2 Answers

Sort by ยป oldest newest most voted
0

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

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

Comments

This didn't solve it for me on one of my machines, but for completeness: sudo -H pip2 install --upgrade piphttps://askubuntu.com/questions/71233...

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

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

fvd gravatar image

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 612 times

Last updated: Mar 23