diff --git a/.github/scripts/compile_and_test.sh b/.github/scripts/compile_and_test.sh
index 7f850b330d4d05d824c5ccc049ac2ffb7b8ea610..d8be0c2d97675e562e36eb55e9a4528303431ead 100755
--- a/.github/scripts/compile_and_test.sh
+++ b/.github/scripts/compile_and_test.sh
@@ -33,7 +33,9 @@ ctest --output-on-failure -j4 && \
 cd ../examples/ && \
 mkdir build && \
 cd build && \
-cmake -GNinja -DBoost_NO_BOOST_CMAKE=ON -DCMAKE_CXX_STANDARD=${STANDARD} .. && \
+cmake -GNinja \
+      -DBoost_NO_BOOST_CMAKE=ON \
+      -DCMAKE_CXX_STANDARD=${STANDARD} .. && \
 ninja && \
 ninja install && \
 ctest --output-on-failure -j2
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e57171accf87176d640811f3e17ef3ffb43a25f8..18948d7a1713d3d3101560bbed0ba4d807c95950 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -118,11 +118,6 @@ dd4hep_configure_output( OUTPUT "${PROJECT_BINARY_DIR}" INSTALL "${CMAKE_INSTALL
 # Resolve dependencies #
 ########################
 
-# Configure Python
-set(Python_FIND_FRAMEWORK LAST)
-find_package(Python COMPONENTS Development)
-set(DD4HEP_PYTHON_INSTALL_DIR lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages)
-
 # Configure ROOT
 find_package (ROOT 6.08 REQUIRED)
 DD4HEP_SETUP_ROOT_TARGETS()
diff --git a/cmake/DD4hepBuild.cmake b/cmake/DD4hepBuild.cmake
index eff65340f716c93afd97949442a1b997b211b506..342fc13d3d06c5d9739ec1c20513d06ddc2fdc80 100644
--- a/cmake/DD4hepBuild.cmake
+++ b/cmake/DD4hepBuild.cmake
@@ -649,16 +649,16 @@ endfunction(dd4hep_add_plugin)
 macro(DD4HEP_SETUP_ROOT_TARGETS)
 
   #Check if Python version detected matches the version used to build ROOT
-  IF(${ROOT_VERSION} VERSION_GREATER_EQUAL 6.19)
-    IF(${ROOT_PYTHON_VERSION} EQUAL ${Python_VERSION})
-      dd4hep_debug( "D++> Python version used for building ROOT ${ROOT_PYTHON_VERSION}" )
-    ELSE()
-      dd4hep_print( "Python version used to build ROOT = ${ROOT_PYTHON_VERSION}" )
-      dd4hep_print( "Python version detected by CMake to build DD4hep = ${Python_VERSION}" )
-      #dd4hep_fatal( "Mismatch between Python version used for building ROOT and Python version detected by CMake" )
-    ENDIF()
+  SET(Python_FIND_FRAMEWORK LAST)
+  IF((TARGET ROOT::PyROOT OR TARGET ROOT::ROOTTPython) AND ${ROOT_VERSION} VERSION_GREATER_EQUAL 6.19)
+    dd4hep_debug( "D++> Python version used for building ROOT ${ROOT_PYTHON_VERSION}" )
+    FIND_PACKAGE(Python ${ROOT_PYTHON_VERSION} EXACT REQUIRED COMPONENTS Development)
+  ELSE()
+    FIND_PACKAGE(Python COMPONENTS Development)
   ENDIF()
 
+  SET(DD4HEP_PYTHON_INSTALL_DIR lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages)
+
   # root python changes target name in 6.22
   IF(TARGET ROOT::PyROOT)
     SET(DD4HEP_ROOT_PYTHON ROOT::PyROOT)
diff --git a/cmake/DD4hepConfig.cmake.in b/cmake/DD4hepConfig.cmake.in
index 5b6d798dbe69e0f48b61af9b2a5950fdcc82aedc..f1e309c8e1650b7a3be4e9521d9779da29d763f2 100644
--- a/cmake/DD4hepConfig.cmake.in
+++ b/cmake/DD4hepConfig.cmake.in
@@ -60,8 +60,6 @@ if(DD4HEP_USE_GEANT4)
   DD4HEP_SETUP_GEANT4_TARGETS()
 endif()
 
-FIND_DEPENDENCY(Python COMPONENTS Development)
-
 FIND_DEPENDENCY(ROOT REQUIRED)
 DD4HEP_SETUP_ROOT_TARGETS()