+# Souce the python version from lf-env.sh if available.
+python="python3"
+if [[ -f ~/lf-env.sh ]]; then
+ # shellcheck source=/dev/null
+ source ~/lf-env.sh
+ lf-activate-venv --python "$python" lftools
+ # Save the virtualenv path
+ # shellcheck disable=SC2154
+ echo "$lf_venv" > "/tmp/.os_lf_venv"
+elif [[ -d /opt/pyenv ]]; then
+ echo "Setup up pyenv"
+ export PYENV_ROOT="/opt/pyenv"
+ export PATH="$PYENV_ROOT/bin:$PATH"
+ pyenv versions
+ if command -v pyenv 1>/dev/null 2>&1; then
+ eval "$(pyenv init - --no-rehash)"
+ pyenv local "$python"
+ fi
+fi
+