diff --git a/executorlib/shared/executor.py b/executorlib/shared/executor.py index b967a218..9ebdc6b2 100644 --- a/executorlib/shared/executor.py +++ b/executorlib/shared/executor.py @@ -326,9 +326,11 @@ def execute_parallel_tasks( conda_environment_name (str): name of the conda environment to initialize conda_environment_path (str): path of the conda environment to initialize """ + conda = conda_environment_name is not None or conda_environment_path is not None interface = interface_bootup( command_lst=_get_backend_path( cores=cores, + conda=conda, ), connections=spawner(cores=cores, **kwargs), hostname_localhost=hostname_localhost, @@ -486,6 +488,7 @@ def get_command_path(executable: str) -> str: def _get_backend_path( cores: int, + conda: bool = False, ) -> list: """ Get command to call backend as a list of two strings @@ -496,7 +499,10 @@ def _get_backend_path( Returns: list[str]: List of strings containing the python executable path and the backend script to execute """ - command_lst = [sys.executable] + if not conda: + command_lst = [sys.executable] + else: + commands_lst = ["python"] if cores > 1 and importlib.util.find_spec("mpi4py") is not None: command_lst += [get_command_path(executable="interactive_parallel.py")] elif cores > 1: