Add Conda env deactivation to installer scripts

Avoids conflicts with existing Conda installations
This commit is contained in:
jllllll 2023-09-21 21:52:29 -05:00
parent 6bbfc40d10
commit cd1049eded
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 7FCD00C417935797
10 changed files with 28 additions and 4 deletions

View file

@ -4,6 +4,9 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
if [[ "$(pwd)" =~ " " ]]; then echo This script relies on Miniconda which can not be silently installed under a path with spaces. && exit; fi if [[ "$(pwd)" =~ " " ]]; then echo This script relies on Miniconda which can not be silently installed under a path with spaces. && exit; fi
# deactivate existing conda envs as needed to avoid conflicts
{ conda deactivate && conda deactivate && conda deactivate; } 2> /dev/null
# config # config
CONDA_ROOT_PREFIX="$(pwd)/installer_files/conda" CONDA_ROOT_PREFIX="$(pwd)/installer_files/conda"
INSTALL_ENV_DIR="$(pwd)/installer_files/env" INSTALL_ENV_DIR="$(pwd)/installer_files/env"

View file

@ -4,8 +4,8 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
if [[ "$(pwd)" =~ " " ]]; then echo This script relies on Miniconda which can not be silently installed under a path with spaces. && exit; fi if [[ "$(pwd)" =~ " " ]]; then echo This script relies on Miniconda which can not be silently installed under a path with spaces. && exit; fi
# deactivate existing env if needed # deactivate existing conda envs as needed to avoid conflicts
conda deactivate 2> /dev/null { conda deactivate && conda deactivate && conda deactivate; } 2> /dev/null
# config # config
CONDA_ROOT_PREFIX="$(pwd)/installer_files/conda" CONDA_ROOT_PREFIX="$(pwd)/installer_files/conda"

View file

@ -10,6 +10,9 @@ echo "%CD%"| findstr /C:" " >nul && echo This script relies on Miniconda which c
set TMP=%cd%\installer_files set TMP=%cd%\installer_files
set TEMP=%cd%\installer_files set TEMP=%cd%\installer_files
@rem deactivate existing conda envs as needed to avoid conflicts
(conda deactivate && conda deactivate && conda deactivate) 2>null
@rem config @rem config
set CONDA_ROOT_PREFIX=%cd%\installer_files\conda set CONDA_ROOT_PREFIX=%cd%\installer_files\conda
set INSTALL_ENV_DIR=%cd%\installer_files\env set INSTALL_ENV_DIR=%cd%\installer_files\env

View file

@ -4,6 +4,9 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
if [[ "$(pwd)" =~ " " ]]; then echo This script relies on Miniconda which can not be silently installed under a path with spaces. && exit; fi if [[ "$(pwd)" =~ " " ]]; then echo This script relies on Miniconda which can not be silently installed under a path with spaces. && exit; fi
# deactivate existing conda envs as needed to avoid conflicts
{ conda deactivate && conda deactivate && conda deactivate; } 2> /dev/null
OS_ARCH=$(uname -m) OS_ARCH=$(uname -m)
case "${OS_ARCH}" in case "${OS_ARCH}" in
x86_64*) OS_ARCH="x86_64";; x86_64*) OS_ARCH="x86_64";;

View file

@ -4,6 +4,9 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
if [[ "$(pwd)" =~ " " ]]; then echo This script relies on Miniconda which can not be silently installed under a path with spaces. && exit; fi if [[ "$(pwd)" =~ " " ]]; then echo This script relies on Miniconda which can not be silently installed under a path with spaces. && exit; fi
# deactivate existing conda envs as needed to avoid conflicts
{ conda deactivate && conda deactivate && conda deactivate; } 2> /dev/null
# M Series or Intel # M Series or Intel
OS_ARCH=$(uname -m) OS_ARCH=$(uname -m)
case "${OS_ARCH}" in case "${OS_ARCH}" in

View file

@ -17,6 +17,9 @@ set SPCHARMESSAGE=
set TMP=%cd%\installer_files set TMP=%cd%\installer_files
set TEMP=%cd%\installer_files set TEMP=%cd%\installer_files
@rem deactivate existing conda envs as needed to avoid conflicts
(conda deactivate && conda deactivate && conda deactivate) 2>null
@rem config @rem config
set INSTALL_DIR=%cd%\installer_files set INSTALL_DIR=%cd%\installer_files
set CONDA_ROOT_PREFIX=%cd%\installer_files\conda set CONDA_ROOT_PREFIX=%cd%\installer_files\conda

View file

@ -4,6 +4,9 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
if [[ "$(pwd)" =~ " " ]]; then echo This script relies on Miniconda which can not be silently installed under a path with spaces. && exit; fi if [[ "$(pwd)" =~ " " ]]; then echo This script relies on Miniconda which can not be silently installed under a path with spaces. && exit; fi
# deactivate existing conda envs as needed to avoid conflicts
{ conda deactivate && conda deactivate && conda deactivate; } 2> /dev/null
# config # config
CONDA_ROOT_PREFIX="$(pwd)/installer_files/conda" CONDA_ROOT_PREFIX="$(pwd)/installer_files/conda"
INSTALL_ENV_DIR="$(pwd)/installer_files/env" INSTALL_ENV_DIR="$(pwd)/installer_files/env"

View file

@ -4,6 +4,9 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
if [[ "$(pwd)" =~ " " ]]; then echo This script relies on Miniconda which can not be silently installed under a path with spaces. && exit; fi if [[ "$(pwd)" =~ " " ]]; then echo This script relies on Miniconda which can not be silently installed under a path with spaces. && exit; fi
# deactivate existing conda envs as needed to avoid conflicts
{ conda deactivate && conda deactivate && conda deactivate; } 2> /dev/null
# config # config
CONDA_ROOT_PREFIX="$(pwd)/installer_files/conda" CONDA_ROOT_PREFIX="$(pwd)/installer_files/conda"
INSTALL_ENV_DIR="$(pwd)/installer_files/env" INSTALL_ENV_DIR="$(pwd)/installer_files/env"

View file

@ -10,6 +10,9 @@ echo "%CD%"| findstr /C:" " >nul && echo This script relies on Miniconda which c
set TMP=%cd%\installer_files set TMP=%cd%\installer_files
set TEMP=%cd%\installer_files set TEMP=%cd%\installer_files
@rem deactivate existing conda envs as needed to avoid conflicts
(conda deactivate && conda deactivate && conda deactivate) 2>null
@rem config @rem config
set CONDA_ROOT_PREFIX=%cd%\installer_files\conda set CONDA_ROOT_PREFIX=%cd%\installer_files\conda
set INSTALL_ENV_DIR=%cd%\installer_files\env set INSTALL_ENV_DIR=%cd%\installer_files\env

4
wsl.sh
View file

@ -15,8 +15,8 @@ read -n1 -p "Continue the installer anyway? [y,n]" EXIT_PROMPT
if ! [[ $EXIT_PROMPT == "Y" || $EXIT_PROMPT == "y" ]]; then exit; fi if ! [[ $EXIT_PROMPT == "Y" || $EXIT_PROMPT == "y" ]]; then exit; fi
fi fi
# deactivate any currently active conda env # deactivate existing conda envs as needed to avoid conflicts
conda deactivate 2> /dev/null { conda deactivate && conda deactivate && conda deactivate; } 2> /dev/null
# config unlike other scripts, can't use current directory due to file IO bug in WSL, needs to be in virtual drive # config unlike other scripts, can't use current directory due to file IO bug in WSL, needs to be in virtual drive
INSTALL_DIR="$HOME/text-gen-install" INSTALL_DIR="$HOME/text-gen-install"