From 985bf19a30b847ff112b7f185a2088eb1a6474c1 Mon Sep 17 00:00:00 2001 From: bmaltais Date: Sat, 3 Jun 2023 07:05:20 -0400 Subject: [PATCH] Fix setup logic... again --- README.md | 2 +- gui.bat | 3 +++ setup.bat | 30 +++++++++++++++++------------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 55b144960..e16099fc5 100644 --- a/README.md +++ b/README.md @@ -345,7 +345,7 @@ This will store a backup file with your current locally installed pip packages a ## Change History -* 2023/06/02 (v21.6.2) +* 2023/06/02 (v21.6.3) - Fix install issue with setup logic * 2023/06/02 (v21.6.2) - Fix install issue with torch version diff --git a/gui.bat b/gui.bat index 9b14c5dfe..34b7bcb16 100644 --- a/gui.bat +++ b/gui.bat @@ -6,6 +6,9 @@ set "yellow_text=" set "blue_text=" set "reset_text=" +:: Deactivate the virtual environment +call .\venv\Scripts\deactivate.bat + REM Run pip freeze and capture the output for /f "delims=" %%I in ('pip freeze') do ( set "pip_output=%%I" diff --git a/setup.bat b/setup.bat index 3bec1156b..2635330c9 100644 --- a/setup.bat +++ b/setup.bat @@ -6,6 +6,23 @@ set "yellow_text=" set "blue_text=" set "reset_text=" +set PYTHON_VER=3.10.9 + +REM Check if Python version meets the recommended version +python --version 2>nul | findstr /b /c:"Python %PYTHON_VER%" >nul +if errorlevel 1 ( + echo Warning: Python version %PYTHON_VER% is recommended. +) + +IF NOT EXIST venv ( + python -m venv venv +) ELSE ( + echo venv folder already exists, skipping creation... +) + +:: Deactivate the virtual environment +call .\venv\Scripts\deactivate.bat + REM Run pip freeze and capture the output for /f "delims=" %%I in ('pip freeze') do ( set "pip_output=%%I" @@ -52,19 +69,6 @@ if /i "%choice%"=="1" ( :ContinueSetup endlocal -set PYTHON_VER=3.10.9 - -REM Check if Python version meets the recommended version -python --version 2>nul | findstr /b /c:"Python %PYTHON_VER%" >nul -if errorlevel 1 ( - echo Warning: Python version %PYTHON_VER% is recommended. -) - -IF NOT EXIST venv ( - python -m venv venv -) ELSE ( - echo venv folder already exists, skipping creation... -) call .\venv\Scripts\activate.bat REM Upgrade pip if needed