mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-29 19:05:05 +08:00
Merge pull request #15750 from MarcusNyne/m9-240509-pip-upgrade
When creating a virtual environment, upgrade pip in webui.bat/webui.sh
This commit is contained in:
commit
5abdf5191d
@ -37,10 +37,15 @@ if %ERRORLEVEL% == 0 goto :activate_venv
|
|||||||
for /f "delims=" %%i in ('CALL %PYTHON% -c "import sys; print(sys.executable)"') do set PYTHON_FULLNAME="%%i"
|
for /f "delims=" %%i in ('CALL %PYTHON% -c "import sys; print(sys.executable)"') do set PYTHON_FULLNAME="%%i"
|
||||||
echo Creating venv in directory %VENV_DIR% using python %PYTHON_FULLNAME%
|
echo Creating venv in directory %VENV_DIR% using python %PYTHON_FULLNAME%
|
||||||
%PYTHON_FULLNAME% -m venv "%VENV_DIR%" >tmp/stdout.txt 2>tmp/stderr.txt
|
%PYTHON_FULLNAME% -m venv "%VENV_DIR%" >tmp/stdout.txt 2>tmp/stderr.txt
|
||||||
if %ERRORLEVEL% == 0 goto :activate_venv
|
if %ERRORLEVEL% == 0 goto :upgrade_pip
|
||||||
echo Unable to create venv in directory "%VENV_DIR%"
|
echo Unable to create venv in directory "%VENV_DIR%"
|
||||||
goto :show_stdout_stderr
|
goto :show_stdout_stderr
|
||||||
|
|
||||||
|
:upgrade_pip
|
||||||
|
"%VENV_DIR%\Scripts\Python.exe" -m pip install --upgrade pip
|
||||||
|
if %ERRORLEVEL% == 0 goto :activate_venv
|
||||||
|
echo Warning: Failed to upgrade PIP version
|
||||||
|
|
||||||
:activate_venv
|
:activate_venv
|
||||||
set PYTHON="%VENV_DIR%\Scripts\Python.exe"
|
set PYTHON="%VENV_DIR%\Scripts\Python.exe"
|
||||||
echo venv %PYTHON%
|
echo venv %PYTHON%
|
||||||
|
1
webui.sh
1
webui.sh
@ -210,6 +210,7 @@ then
|
|||||||
if [[ ! -d "${venv_dir}" ]]
|
if [[ ! -d "${venv_dir}" ]]
|
||||||
then
|
then
|
||||||
"${python_cmd}" -m venv "${venv_dir}"
|
"${python_cmd}" -m venv "${venv_dir}"
|
||||||
|
"${venv_dir}"/bin/python -m pip install --upgrade pip
|
||||||
first_launch=1
|
first_launch=1
|
||||||
fi
|
fi
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
|
Loading…
Reference in New Issue
Block a user