From 80f20324859cc88dbb4e41c95d961c601eb0aec2 Mon Sep 17 00:00:00 2001 From: Dmitry Rogozhkin Date: Wed, 29 Jan 2025 21:24:22 -0800 Subject: [PATCH] Fix running stack built with base conda environment (#903) Fixes: #902 For the test verified that llama stack can run if built: * With default "base" conda environment * With new custom conda environment using `--image-name XXX` option In both cases llama stack starts fine (was failing with "base") before this patch. CC: @ashwinb Signed-off-by: Dmitry Rogozhkin --- llama_stack/cli/stack/run.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llama_stack/cli/stack/run.py b/llama_stack/cli/stack/run.py index 62a45ada0..48b443524 100644 --- a/llama_stack/cli/stack/run.py +++ b/llama_stack/cli/stack/run.py @@ -140,6 +140,10 @@ class StackRun(Subcommand): return def get_conda_prefix(env_name): + # Conda "base" environment does not end with "base" in the + # prefix, so should be handled separately. + if env_name == "base": + return os.environ.get("CONDA_PREFIX") # Get conda environments info conda_env_info = json.loads( subprocess.check_output(