Python 3.12: "ModuleNotFoundError: No module named 'distutils'"
@devsingh05▲ 10 net votes
distutils was removed from the standard library in Python 3.12. Old packages (and old node-gyp versions, which call Python during npm installs) that import it break. Install setuptools, which provides a distutils shim: pip install setuptools. Better, upgrade the package that needs it to a release that supports 3.12, or create the environment with Python 3.11 if the dependency is abandoned.