From a041e7f0efcd5105296f95076ad9cc4607928575 Mon Sep 17 00:00:00 2001 From: Joel Mathew Thomas <90510078+joelmathewthomas@users.noreply.github.com> Date: Sun, 26 Jan 2025 18:11:19 +0530 Subject: [PATCH] add script which can be sourced to setup the current SHELL environment --- scripts/activate.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 scripts/activate.sh diff --git a/scripts/activate.sh b/scripts/activate.sh new file mode 100755 index 0000000..8e3fa01 --- /dev/null +++ b/scripts/activate.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Define the paths for the environments +ENV_1_PATH="envs/env" +ENV_2_PATH="envs/env_tensorflow" + +# Check if the environments exist +if [ ! -d "$ENV_1_PATH" ] || [ ! -d "$ENV_2_PATH" ]; then + echo "One or both environments do not exist in the 'envs/' directory." + exit 1 +fi + +# Activate the first environment (default) +echo "Activating environment '$ENV_1_PATH'..." +source "$ENV_1_PATH/bin/activate" + +# Export PYTHONPATH to include both environments' site-packages +export PYTHONPATH="$PWD/$ENV_1_PATH/lib/python3.12/site-packages:$PWD/$ENV_2_PATH/lib/python3.12/site-packages" + +echo "Environment set up successfully. PYTHONPATH set to include both environments." + +# Optionally, print the current PYTHONPATH to verify +echo "PYTHONPATH=${PYTHONPATH}"