diff --git a/setup.py b/setup.py
index 87656a5c07f5b04005181a819bb0fa0fbf095645..4cc1483980ea6c938e7b5e0af5237cccb65e4290 100644
--- a/setup.py
+++ b/setup.py
@@ -44,7 +44,17 @@ class CMakeBuild(build_ext):
 
         os.chdir(str(build_temp))
 
-        compile_type = "Debug"
+        # Impose to use the executable of the python                                                                                                                                                  
+        # used to launch setup.py to setup PythonInterp                                                                                                                                                   
+        python_executable = sys.executable                                                                                                                                                                
+        print(f"python executable :\t{python_executable}")                                                                                                                                                   
+
+        compile_type = (
+            "Release"
+            if "AIDGE_BUILD_TYPE" not in os.environ
+            else os.environ["AIDGE_BUILD_TYPE"]
+        )
+
         install_path = (
             os.path.join(sys.prefix, "lib", "libAidge")
             if "AIDGE_INSTALL" not in os.environ
@@ -54,13 +64,13 @@ class CMakeBuild(build_ext):
             [
                 "cmake",
                 str(cwd),
-                f"-DPYTHON_EXECUTABLE={sys.executable}",
+                f"-DPYTHON_EXECUTABLE={python_executable}",
                 "-DTEST=OFF",
                 f"-DCMAKE_INSTALL_PREFIX:PATH={install_path}",
                 f"-DCMAKE_BUILD_TYPE={compile_type}",
                 "-DPYBIND=ON",
                 "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
-                "-DCOVERAGE=OFF"
+                "-DCOVERAGE=OFF",
             ]
         )
         if not self.dry_run: