When re-running some old Python script in a new env., I sometimes get ModuleNotFoundError: No module named 'distutils.msvccompiler', even if I’ve installed all dependencies already.1 It’s probably due to the fact that some old packages we use do not take care of the removal of old MSVC modules from setuptools (pypa/setuptools#3505). Usually, pip install setuptools should fix it. If not, try something like pip install "setuptools<68" or pip install "setuptools<65" and so on.