Activate the installer env while starting up, like the previous installer did in the start script

This commit is contained in:
cmdr2 2022-10-25 19:21:26 +05:30
parent a281efef04
commit 0c2d227da1
4 changed files with 9 additions and 11 deletions

View File

@ -11,6 +11,9 @@ call scripts\bootstrap.bat
@rem set new installer's PATH, if it downloaded any packages @rem set new installer's PATH, if it downloaded any packages
if exist "installer_files\env" set PATH=%cd%\installer_files\env;%cd%\installer_files\env\Library\bin;%cd%\installer_files\env\Scripts;%cd%\installer_files\Library\usr\bin;%PATH% if exist "installer_files\env" set PATH=%cd%\installer_files\env;%cd%\installer_files\env\Library\bin;%cd%\installer_files\env\Scripts;%cd%\installer_files\Library\usr\bin;%PATH%
@rem activate the installer env
conda activate
@rem Test the bootstrap @rem Test the bootstrap
call where git call where git
call git --version call git --version

View File

@ -68,10 +68,6 @@ if exist "%cd%\profile" (
set TMP=%cd%\tmp set TMP=%cd%\tmp
set TEMP=%cd%\tmp set TEMP=%cd%\tmp
@REM deactivate any pre-activated conda environments, by returning to (base) and then deactivating that
call conda activate
call conda deactivate
@call conda env create --prefix env -f environment.yaml || ( @call conda env create --prefix env -f environment.yaml || (
@echo. & echo "Error installing the packages necessary for Stable Diffusion. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo. @echo. & echo "Error installing the packages necessary for Stable Diffusion. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo.
pause pause

View File

@ -3,9 +3,6 @@
cp sd-ui-files/scripts/on_env_start.sh scripts/ cp sd-ui-files/scripts/on_env_start.sh scripts/
cp sd-ui-files/scripts/bootstrap.sh scripts/ 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)
# remove the old version of the dev console script, if it's still present # remove the old version of the dev console script, if it's still present
if [ -e "open_dev_console.sh" ]; then if [ -e "open_dev_console.sh" ]; then
rm "open_dev_console.sh" rm "open_dev_console.sh"
@ -62,10 +59,6 @@ else
# prevent conda from using packages from the user's home directory, to avoid conflicts # prevent conda from using packages from the user's home directory, to avoid conflicts
export PYTHONNOUSERSITE=1 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 if conda env create --prefix env --force -f environment.yaml ; then
echo "Installed. Testing.." echo "Installed. Testing.."
else else

View File

@ -9,6 +9,12 @@ scripts/bootstrap.sh
# set new installer's PATH, if it downloaded any packages # set new installer's PATH, if it downloaded any packages
if [ -e "installer_files/env" ]; then export PATH="$(pwd)/installer_files/env/bin:$PATH"; fi if [ -e "installer_files/env" ]; then export PATH="$(pwd)/installer_files/env/bin:$PATH"; fi
# activate the installer env
CONDA_BASEPATH=$(conda info --base)
source "$CONDA_BASEPATH/etc/profile.d/conda.sh" # avoids the 'shell not initialized' error
conda activate
# Test the bootstrap # Test the bootstrap
which git which git
git --version git --version