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 <dmitry.v.rogozhkin@intel.com>
This commit is contained in:
Dmitry Rogozhkin 2025-01-29 21:24:22 -08:00 committed by GitHub
parent 39c34dd25f
commit 80f2032485
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(