From d19cebf2e3f726f09bae13045416ccfcb30e2766 Mon Sep 17 00:00:00 2001 From: Thierry RAMORASOAVINA Date: Wed, 26 Aug 2026 10:57:50 +0200 Subject: [PATCH] Give the user a hint on Windows when khiops_env.cmd fails khiops_env.cmd failure on Windows is usually caused by security policies preventing executables from running if they are located outside approved locations --- khiops/core/internals/runner.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/khiops/core/internals/runner.py b/khiops/core/internals/runner.py index e9d7cb71..9edefce5 100644 --- a/khiops/core/internals/runner.py +++ b/khiops/core/internals/runner.py @@ -1019,10 +1019,20 @@ def _initialize_khiops_environment(self): ) as khiops_env_process: stdout, stderr = khiops_env_process.communicate() if khiops_env_process.returncode != 0: - raise KhiopsEnvironmentError( + error_message = ( "Error initializing the environment for Khiops from the " f"{khiops_env_path} script. Contents of stderr:\n{stderr}" ) + if platform.system() == "Windows": + # Give the user a hint to resolve the issue on Windows + error_message += ( + "\nThe issue may be caused by Khiops being installed " + "in a location restricted by your organization's IT " + "security policy. In this case, try re-installing " + "the Khiops Python Library in a recommended directory " + "or run your IDE or terminal as an administrator." + ) + raise KhiopsEnvironmentError(error_message) for line in stdout.split("\n"): tokens = line.rstrip().split(maxsplit=1) if len(tokens) == 2: