I had this error too and solved it. It came for me from a mixup between python2 and python3 during build. Use ROS_PYTHON_VERSION environment variable to force build with a specific version of python.
Debian Buster IS a supported OS for noetic, though not the main one which is Ubuntu Buster. OP does not need to be told "Noetic should not be installed on this OS", he/she needs help to solve his/her issue. Solving a problem is better than just eluding it, in my opinion.
My setup is a bit more tricky:
- hardware: Raspberry Pi 4
- OS: raspbian buster
- Installing ROS noetic (currently 1.15.7) in a docker image which guest OS is raspbian buster too, so it should be the same as installing it directly on host OS.
- Using python3 to install ROS
Instructions below. I hope it will help.
mkdir ~/catkin_ws && cd ~/catkin_ws
export ROS_DISTRO="noetic"
# I very strongly advise to set Python version used by ROS
# otherwise the packages will mix up python2 and python3 during build
# finally leading to the error you encountered (just like me before)
export ROS_PYTHON_VERSION="3"
# disable languages that I don't need
export ROS_LANG_DISABLE="geneus:genlisp:gennodejs"
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu buster main" > /etc/apt/sources.list.d/ros-latest.list'
apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
apt-get update
apt-get install python3-rosdep python3-rosinstall-generator python3-vcstool build-essential
apt-get install -y ca-certificates && rosdep init && rosdep update
# Remove/add packages to get an installation covering your needs.
rosinstall_generator --rosdistro noetic --deps --tar \
ros_comm \
actionlib \
sensor_msgs \
image_common \
vision_opencv \
> noetic-computervision.rosinstall
mkdir ./src && vcs import --input noetic-computervision.rosinstall ./src
rosdep install --from-paths ./src --ignore-packages-from-source --rosdistro noetic -y
python3 ./src/catkin/bin/catkin_make_isolated --install --install-space /opt/ros/noetic -DCMAKE_BUILD_TYPE=Release