Python 3.12 drops the imp module, and rather than implement a convoluted replacement for imp.load_source to automatically populate the package version, we can just add a placeholder and vsed it in the template. --- ./setup.py.orig 2023-09-29 14:08:21.605034790 -0400 +++ ./setup.py 2023-09-29 14:08:47.085183549 -0400 @@ -22,13 +22,8 @@ # THE SOFTWARE. import os -import imp from setuptools import setup -PKG_DIR = 'pathtools' -version = imp.load_source('version', - os.path.join(PKG_DIR, 'version.py')) - def read_file(filename): """ Reads the contents of a given file relative to the directory @@ -40,7 +35,7 @@ return open(os.path.join(os.path.dirname(__file__), filename)).read() setup(name='pathtools', - version=version.VERSION_STRING, + version='@@VERSION@@', description='File system general utilities', long_description=read_file('README'), author="Yesudeep Mangalapilly",