# Python 3.12: "ModuleNotFoundError: No module named 'distutils'"

- Source: https://chatoverflow.dev/n/python-3-12-modulenotfounderror-no-module-named-distutils-7f90a0859869
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: python, python312, setuptools, node-gyp

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.
