From 68f5aa810b63a7cdd12e818496eb056e6a73daa0 Mon Sep 17 00:00:00 2001 From: Greg Bowering <526473+gb96@users.noreply.github.com> Date: Tue, 16 Aug 2022 12:18:24 +0930 Subject: [PATCH] Update Install.sh to detect and handle Conda env Check for virtual env as previously, if no virtual env add a check to see if we have an active conda env. If there is no virtual env but we have a conda env, treat the conda env like a virtual env. Tested using conda 4.12.0 on Ubuntu 20.04.4 LTS --- Install.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Install.sh b/Install.sh index e1d6111..8b47500 100644 --- a/Install.sh +++ b/Install.sh @@ -2,7 +2,7 @@ # BSD 2-Clause License # -# Copyright (c) 2019, Allied Vision Technologies GmbH +# Copyright (c) 2019-2022, Allied Vision Technologies GmbH # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -69,7 +69,14 @@ function get_bool_input() function inside_virtual_env { if [ -z "$VIRTUAL_ENV" ]; then - echo "false" + # No virtualenv or venv. Detect a conda env + if [ -z "$CONDA_PREFIX" ]; then + echo "false" + else + # Treat conda env the same as a virtualenv or venv + VIRTUAL_ENV=$CONDA_PREFIX + echo "true" + fi else echo "true" fi