ROS 1 and Python 3.10's deprecation of distutils.core

Before Noetic was released, many packages were switched to setuptools because distutils was split into a separate package in Debian Buster and Ubuntu Focal. If I recall correctly, the distutils import will only work on Focal if python3-distutils is installed. See this and linked PRs:
Prefer setuptools with Python 3 by sloretz · Pull Request #1048 · ros/catkin · GitHub.

I think it’s safer to assume setuptools is available rather than distutils because Catkin only exports a dependency on setuptools. Adding the buildtool_depend on python-setuptools was only required if one was trying to support Melodic and Noetic on the same branch.

1 Like