From be6c5b25843d90290db8adc3cba3c5663d21689c Mon Sep 17 00:00:00 2001 From: Carlos Marques Date: Tue, 3 Dec 2024 14:24:11 -0300 Subject: [PATCH] Add conda support to activation script --- src/ert/config/queue_config.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ert/config/queue_config.py b/src/ert/config/queue_config.py index 576e0f8934b..5dad891d017 100644 --- a/src/ert/config/queue_config.py +++ b/src/ert/config/queue_config.py @@ -29,9 +29,12 @@ def activate_script() -> str: venv = os.environ.get("VIRTUAL_ENV") - if not venv: - return "" - return f"source {venv}/bin/activate" + if venv: + return f"source {venv}/bin/activate" + conda_env = os.environ.get("CONDA_ENV") + if conda_env: + return f'eval "$(conda shell.bash hook)" && conda activate {conda_env}' + return "" @pydantic.dataclasses.dataclass(config={"extra": "forbid", "validate_assignment": True})