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

rosdep install cannot import OS_RASPBIAN ?

asked 2022-07-09 05:23:07 -0500

Pete gravatar image

updated 2022-07-16 16:04:34 -0500

Mike Scheutzow gravatar image

I'm running into this issue:

pi@nemarobot:~/ros_catkin_ws $ rosdep install -y --from-paths src --ignore-src --rosdistro melodic -r --os=debian:bullseye
Traceback (most recent call last):
  File "/usr/local/bin/rosdep", line 5, in <module>
    from rosdep2.main import rosdep_main
  File "/usr/local/lib/python3.9/dist-packages/rosdep2/__init__.py", line 45, in <module>
    from .lookup import RosdepDefinition, RosdepView, RosdepLookup, \
  File "/usr/local/lib/python3.9/dist-packages/rosdep2/lookup.py", line 44, in <module>
    from .sources_list import SourcesListLoader
  File "/usr/local/lib/python3.9/dist-packages/rosdep2/sources_list.py", line 42, in <module>
    from .gbpdistro_support import get_gbprepo_as_rosdep_data, download_gbpdistro_as_rosdep_data
  File "/usr/local/lib/python3.9/dist-packages/rosdep2/gbpdistro_support.py", line 14, in <module>
    from .platforms.debian import APT_INSTALLER
  File "/usr/local/lib/python3.9/dist-packages/rosdep2/platforms/debian.py", line 34, in <module>
    from rospkg.os_detect import (
ImportError: cannot import name 'OS_RASPBIAN' from 'rospkg.os_detect' (/home/pi/.local/lib/python3.9/site-packages/rospkg/os_detect.py)
edit retag flag offensive close merge delete

Comments

I am building ROS docker images regularly for Noetic and regularly am running into this. I haven't found a permanent solution, but occasionally it seems to be tied to a conflict with different versions/installations of rospkg or rosdep (typically between Python2 and Python3). Most recently however (what brought me here) is I'm experiencing this despite have uninstalled all other versions (pip2, pip3, apt, etc) and am still getting this error. Sadly, am running into this frequently, and nothing in my environment is OS_RASPIAN. Even re-running previously stable images, it is happening, which makes me think there is some update that is happening after the image is created, but when the container is started, which is triggering it. Despite not being an answer, hopefully this info helps someone else to resolve it.

Kyle M gravatar image Kyle M  ( 2022-10-06 12:40:13 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-10-10 05:09:24 -0500

lewkoo gravatar image

I was able to generate custom images based on the official ROS images and have them successfully run rosdep update after performing the following manipulations to the images:

For xenial (kinetic) distro:

RUN if [ "$(lsb_release -c -s)" = "xenial" ]; then \
apt-get update && apt install -yq python-bloom python-rosdep \
python-rosinstall python-wstool python-pip && pip install rospkg==1.3.0; \
fi

For bionic (melodic) distro:

RUN if [ "$(lsb_release -c -s)" = "bionic" ]; then \
apt-get update && apt install -yq python-bloom python-rosdep \
python-rosinstall python-wstool python-pip && pip install rospkg==1.4.0; \
fi
edit flag offensive delete link more
0

answered 2022-10-09 21:04:18 -0500

marguedas gravatar image

updated 2022-10-09 21:04:41 -0500

It looks like you're using incompatible versions of rospkg and rosdep (rosdep is recent enough to support detecting Raspbian but rospkg is too old and doesn't provide the constant OS_RASPBIAN).

You need rospkg(-modules) v1.4.0 or higher. You can check the currently installed version with: pip3 freeze | grep rospkg You can upgrade it with pip3 install -U rospkg-modules

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-07-09 05:23:07 -0500

Seen: 654 times

Last updated: Oct 09 '22