From ad8b8cb9eb5f285044f6e29927a161ad0d2b86a7 Mon Sep 17 00:00:00 2001 From: itsmarble <130370814+itsmarble@users.noreply.github.com> Date: Thu, 4 May 2023 19:55:58 +0200 Subject: [PATCH] Update run.bat (#3783) Co-authored-by: Richard Beales --- run.bat | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/run.bat b/run.bat index afbab57a0603..be748c005111 100644 --- a/run.bat +++ b/run.bat @@ -1,8 +1,24 @@ @echo off -python scripts/check_requirements.py requirements.txt +setlocal enabledelayedexpansion + +:FindPythonCommand +for %%A in (python python3) do ( + where /Q %%A + if !errorlevel! EQU 0 ( + set "PYTHON_CMD=%%A" + goto :Found + ) +) + +echo Python not found. Please install Python. +pause +exit /B 1 + +:Found +%PYTHON_CMD% scripts/check_requirements.py requirements.txt if errorlevel 1 ( echo Installing missing packages... - pip install -r requirements.txt + %PYTHON_CMD% -m pip install -r requirements.txt ) -python -m autogpt %* -pause +%PYTHON_CMD% -m autogpt %* +pause \ No newline at end of file