<commit_before>diff --git a/wrapping/src/CMakeLists.txt b/wrapping/src/CMakeLists.txt
index a7440569..ec0f82df 100644
--- a/wrapping/src/CMakeLists.txt
+++ b/wrapping/src/CMakeLists.txt
@@ -61,15 +61,16 @@ execute_process(COMMAND ${PYTHON_EXECUTABLE} "-c" "from distutils.sysconfig impo
                 OUTPUT_VARIABLE PYTHON_SITE_ARCH
                 RESULT_VARIABLE PYTHON_SITEARCH_NOT_FOUND)
 #extract correctly python location: e.g lib64/python2.7/site-packages
-string(REGEX MATCH "[Ll]ib.*packages" PYTHON_REL_SITE_ARCH ${PYTHON_SITE_ARCH})
+file(RELATIVE_PATH PYTHON_REL_SITE_ARCH ${CMAKE_INSTALL_PREFIX} ${PYTHON_SITE_ARCH})
+set(PYTHON_SITE_ARCH_ABSOLUTE_PATH "${CMAKE_INSTALL_PREFIX}/${PYTHON_REL_SITE_ARCH}")
 
 install(TARGETS  "_openmeeg"
-        LIBRARY DESTINATION ${PYTHON_REL_SITE_ARCH}
-        RUNTIME DESTINATION ${PYTHON_REL_SITE_ARCH}
+        LIBRARY DESTINATION ${PYTHON_SITE_ARCH_ABSOLUTE_PATH}
+        RUNTIME DESTINATION ${PYTHON_SITE_ARCH_ABSOLUTE_PATH}
         PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
 
 install(FILES  ${OpenMEEG_BINARY_DIR}/wrapping/src/openmeeg.py
-        DESTINATION ${PYTHON_REL_SITE_ARCH}
+        DESTINATION ${PYTHON_SITE_ARCH_ABSOLUTE_PATH}
         PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
 
 # Test Python wrapping
<commit_msg>check out the paths<commit_after>diff --git a/wrapping/src/CMakeLists.txt b/wrapping/src/CMakeLists.txt
index a7440569..745be104 100644
--- a/wrapping/src/CMakeLists.txt
+++ b/wrapping/src/CMakeLists.txt
@@ -58,18 +58,20 @@ swig_add_library(openmeeg LANGUAGE python SOURCES openmeeg.i)
 swig_link_libraries(openmeeg ${PYTHON_LIBRARIES} OpenMEEG::OpenMEEG)
 
 execute_process(COMMAND ${PYTHON_EXECUTABLE} "-c" "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))"
-                OUTPUT_VARIABLE PYTHON_SITE_ARCH
+                OUTPUT_VARIABLE PYTHON_SITE_ARCH_fail
                 RESULT_VARIABLE PYTHON_SITEARCH_NOT_FOUND)
-#extract correctly python location: e.g lib64/python2.7/site-packages
-string(REGEX MATCH "[Ll]ib.*packages" PYTHON_REL_SITE_ARCH ${PYTHON_SITE_ARCH})
+set(PYTHON_SITE_ARCH_work "${CMAKE_INSTALL_PREFIX}/../Lib/site-packages/")
+file(TO_CMAKE_PATH "${PYTHON_SITE_ARCH_fail}" PYTHON_SITE_ARCH_fail)
+message(STATUS "PYTHON_SITE_ARCH_work ${PYTHON_SITE_ARCH_work}")
+message(STATUS "PYTHON_SITE_ARCH_fail ${PYTHON_SITE_ARCH_fail}")
 
 install(TARGETS  "_openmeeg"
-        LIBRARY DESTINATION ${PYTHON_REL_SITE_ARCH}
-        RUNTIME DESTINATION ${PYTHON_REL_SITE_ARCH}
+        LIBRARY DESTINATION ${PYTHON_SITE_ARCH_work}
+        RUNTIME DESTINATION ${PYTHON_SITE_ARCH_work}
         PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
 
 install(FILES  ${OpenMEEG_BINARY_DIR}/wrapping/src/openmeeg.py
-        DESTINATION ${PYTHON_REL_SITE_ARCH}
+        DESTINATION ${PYTHON_SITE_ARCH_fail}
         PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
 
 # Test Python wrapping

{'fraction_non_alphanumeric': 0.09676331759946055, 'fraction_numerical': 0.020229265003371546, 'mean_word_length': 4.863636363636363, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7589437', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1144, 'n_words': 162}