rosdep install cannot import OS_RASPBIAN ?
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)
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.