Currently, we define the following macros: %python3_sitelib %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())") %python3_sitearch %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %python_sitelib %(%{__python} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib())") %python_sitearch %(%{__python} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") But distutils is deprecated in Python 3.10: https://www.python.org/dev/peps/pep-0632/ We need to figure out how to get this data from somewhere else. I've checked and sysconfig does not have get_python_lib(), but it has get_path(). This is a code that we can use: >>> from sysconfig import get_path >>> get_path('platlib') '/usr/lib64/python3.9/site-packages' >>> get_path('purelib') '/usr/lib/python3.9/site-packages' It seems to work across variety of our Pythons: $ for PYTHON in python{2.7,3.{5..10}} pypy2 pypy3; do echo $PYTHON; $PYTHON -c 'from __future__ import print_function; from distutils.sysconfig import get_python_lib; from sysconfig import get_path; print(get_path("platlib"), get_python_lib(1), get_path("platlib")==get_python_lib(1)); print(get_path("purelib"), get_python_lib(), get_path("purelib")==get_python_lib())'; echo; done python2.7 /usr/lib64/python2.7/site-packages /usr/lib64/python2.7/site-packages True /usr/lib/python2.7/site-packages /usr/lib/python2.7/site-packages True python3.5 /usr/lib64/python3.5/site-packages /usr/lib64/python3.5/site-packages True /usr/lib/python3.5/site-packages /usr/lib/python3.5/site-packages True python3.6 /usr/lib64/python3.6/site-packages /usr/lib64/python3.6/site-packages True /usr/lib/python3.6/site-packages /usr/lib/python3.6/site-packages True python3.7 /usr/lib64/python3.7/site-packages /usr/lib64/python3.7/site-packages True /usr/lib/python3.7/site-packages /usr/lib/python3.7/site-packages True python3.8 /usr/lib64/python3.8/site-packages /usr/lib64/python3.8/site-packages True /usr/lib/python3.8/site-packages /usr/lib/python3.8/site-packages True python3.9 /usr/lib64/python3.9/site-packages /usr/lib64/python3.9/site-packages True /usr/lib/python3.9/site-packages /usr/lib/python3.9/site-packages True python3.10 /usr/lib64/python3.10/site-packages /usr/lib64/python3.10/site-packages True /usr/lib/python3.10/site-packages /usr/lib/python3.10/site-packages True pypy2 /usr/lib64/pypy-7.3/site-packages /usr/lib64/pypy-7.3/site-packages True /usr/lib64/pypy-7.3/site-packages /usr/lib64/pypy-7.3/site-packages True pypy3 /usr/lib64/pypy3-7.3/site-packages /usr/lib64/pypy3-7.3/site-packages True /usr/lib64/pypy3-7.3/site-packages /usr/lib64/pypy3-7.3/site-packages True
https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/96
FEDORA-2021-afa6e07b4d has been pushed to the Fedora 35 stable repository. If problem still persists, please make note of it in this bug report.