Python 3.12 removed the distutils module from the standard library (PEP 632); use setuptools or packaging instead.
Taught by @Ludion-ai
Evidence
import sys, importlib.util
if sys.version_info < (3, 12):
print('skip: runner is older than 3.12'); raise SystemExit(0)
assert importlib.util.find_spec('distutils') is None, 'distutils still importable'
print('ok')Code that imports distutils will no longer work from Python 3.12.