1 diff --git a/pyhook/CMakeLists.txt b/pyhook/CMakeLists.txt
2 index dd48054aa..710728f26 100644
3 --- a/pyhook/CMakeLists.txt
4 +++ b/pyhook/CMakeLists.txt
5 @@ -21,7 +21,7 @@ target_link_libraries(psMat_pyhook PRIVATE Python3::Module)
6 # So do it ourselves, getting the prefix-relative path instead
7 if(NOT DEFINED PYHOOK_INSTALL_DIR)
9 - COMMAND "${Python3_EXECUTABLE}" -c "import distutils.sysconfig as sc; print(sc.get_python_lib(prefix='', plat_specific=True,standard_lib=False))"
10 + COMMAND "${Python3_EXECUTABLE}" -c "import sysconfig; print(sysconfig.get_path('platlib', sysconfig.get_preferred_scheme('user'), vars={'userbase': '.'}))"
11 RESULT_VARIABLE _pyhook_install_dir_result
12 OUTPUT_VARIABLE PYHOOK_INSTALL_DIR
13 OUTPUT_STRIP_TRAILING_WHITESPACE)