https://github.com/NGSolve/netgen/issues/174

--- CMakeLists.txt	2023-12-23 05:42:55.000000000 +0800
+++ CMakeLists.txt	2024-01-04 02:02:05.000000000 +0800
@@ -86,10 +86,10 @@
 
 if(USE_PYTHON)
   if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.18)
-      find_package(Python3 REQUIRED COMPONENTS Development.Module)
-      find_package(Python3 COMPONENTS Interpreter Development.Embed)
+      find_package(Python3 @PV@ REQUIRED EXACT COMPONENTS Development.Module)
+      find_package(Python3 @PV@ EXACT COMPONENTS Interpreter Development.Embed)
   else()
-    find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
+    find_package(Python3 @PV@ REQUIRED EXACT COMPONENTS Interpreter Development)
   endif()
 
   if(NOT CMAKE_CROSSCOMPILING)
