Python 3.10+ equivalent to `distutils` package
13:43 04 Mar 2026

I am using Python 3.12 and want to setup the ttpy package version 1.2.1. If I run the pip install ttpy==1.2.1 command, I get an error ModuleNotFoundError: No module named 'numpy.distutils' because distutils was deprecated in Python 3.10.

I tried to update the import statements in ttpy's setup.py file:

from numpy.distutils.core import setup
from numpy.distutils.misc_util import Configuration

The first line can be changed to from distutils.core import setup. How do I change the second line? I tried and failed to find some equivalent module in distutils and setuptools. The various related questions (How can one fully replace distutils, which is deprecated in 3.10?, Why did I get an error ModuleNotFoundError: No module named 'distutils'?, etc) are not helpful.

I am using setuptools-80.9.0 and distutils-3.12.8.

python installation setuptools setup.py distutils