diff --git c/libraries/libapparmor/swig/python/test/buildpath.py w/libraries/libapparmor/swig/python/test/buildpath.py
index 6b805c1b..13596975 100644
--- c/libraries/libapparmor/swig/python/test/buildpath.py
+++ w/libraries/libapparmor/swig/python/test/buildpath.py
@@ -3,7 +3,7 @@
 import sys
 import sysconfig
 import setuptools
-if tuple(map(int,setuptools.__version__.split("."))) >= (61, 2):
+if tuple(map(int,setuptools.__version__.split("."))) >= (62, 0):
     identifier = sys.implementation.cache_tag
 else:
     identifier = "%d.%d" % sys.version_info[:2]
diff --git c/profiles/Makefile w/profiles/Makefile
index 0b7f2655..19d39a79 100644
--- c/profiles/Makefile
+++ w/profiles/Makefile
@@ -41,7 +41,7 @@ ifdef USE_SYSTEM
     LOGPROF?=aa-logprof
 else
     # PYTHON_DIST_BUILD_PATH based on libapparmor/swig/python/test/Makefile.am
-    PYTHON_DIST_BUILD_PATH = ../libraries/libapparmor/swig/python/build/$$($(PYTHON) -c "import sysconfig; print(\"lib.%s-%s\" %(sysconfig.get_platform(), sysconfig.get_python_version()))")
+    PYTHON_DIST_BUILD_PATH = ../libraries/libapparmor/swig/python/build/$$($(PYTHON) ../libraries/libapparmor/swig/python/test/buildpath.py)
     LIBAPPARMOR_PATH=../libraries/libapparmor/src/.libs/
     LD_LIBRARY_PATH=$(LIBAPPARMOR_PATH):$(PYTHON_DIST_BUILD_PATH)
     PYTHONPATH=../utils/:$(PYTHON_DIST_BUILD_PATH)
