The error is that jalali_date uses distutils, but in Python 3.12, distutils is removed and should be replaced with setuptools.
jalali_date
distutils
Python 3.12
setuptools
pip install setuptools