deactivate any pre-activated conda environments, by returning to (base) and then deactivating that. On Windows and Linux

This commit is contained in:
cmdr2
2022-10-25 18:07:29 +05:30
parent 538dcec348
commit a281efef04
2 changed files with 8 additions and 5 deletions

View File

@@ -6,11 +6,6 @@ cp sd-ui-files/scripts/bootstrap.sh scripts/
CONDA_BASEPATH=$(conda info --base)
source "$CONDA_BASEPATH/etc/profile.d/conda.sh" # otherwise conda complains about 'shell not initialized' (needed when running in a script)
# deactivate any pre-activated conda environments
for i in $(seq ${CONDA_SHLVL}); do
conda deactivate
done
# remove the old version of the dev console script, if it's still present
if [ -e "open_dev_console.sh" ]; then
rm "open_dev_console.sh"
@@ -67,6 +62,10 @@ else
# prevent conda from using packages from the user's home directory, to avoid conflicts
export PYTHONNOUSERSITE=1
# deactivate any pre-activated conda environments, by returning to (base) and then deactivating that
conda activate
conda deactivate
if conda env create --prefix env --force -f environment.yaml ; then
echo "Installed. Testing.."
else