From afcf85c3f717e783feeaa4be05ca458102fa093c Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Fri, 25 Jul 2025 14:28:54 +0530 Subject: [PATCH] Fix a conflict where the system-wide python gets picked up on some Windows PCs --- scripts/Developer Console.cmd | 7 +++++-- scripts/on_sd_start.bat | 11 +++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/scripts/Developer Console.cmd b/scripts/Developer Console.cmd index 49e6791d..ee1e8d5b 100644 --- a/scripts/Developer Console.cmd +++ b/scripts/Developer Console.cmd @@ -12,6 +12,9 @@ if exist "installer_files\env" set PATH=%cd%\installer_files\env;%cd%\installer_ set PYTHONPATH=%cd%\installer;%cd%\installer_files\env +set PYTHON=%cd%\installer_files\env\python.exe +echo PYTHON=%PYTHON% + @rem activate the installer env call conda activate @@ -37,8 +40,8 @@ if exist "stable-diffusion\env" ( set PYTHONPATH=%cd%\stable-diffusion\env\lib\site-packages ) -call where python -call python --version +@REM call where python +call "%PYTHON%" --version echo PYTHONPATH=%PYTHONPATH% diff --git a/scripts/on_sd_start.bat b/scripts/on_sd_start.bat index 18823735..e9ccf970 100644 --- a/scripts/on_sd_start.bat +++ b/scripts/on_sd_start.bat @@ -67,14 +67,17 @@ set PYTHONNOUSERSITE=1 set PYTHONPATH=%INSTALL_ENV_DIR%\lib\site-packages echo PYTHONPATH=%PYTHONPATH% +set PYTHON=%INSTALL_ENV_DIR%\python.exe +echo PYTHON=%PYTHON% + @rem Download the required packages -call where python -call python --version +@REM call where python +call "%PYTHON%" --version @rem this is outside check_modules.py to ensure that the required version of torchruntime is present -call python -m pip install -q "torchruntime>=1.19.1" +call "%PYTHON%" -m pip install -q "torchruntime>=1.19.1" -call python scripts\check_modules.py --launch-uvicorn +call "%PYTHON%" scripts\check_modules.py --launch-uvicorn pause exit /b