Files
Auto-GPT/run.sh
amokduke 627aeb20a2 Adds check for Python 3.10 and print error message if required version not detected. (#3598)
* Updated run script to check for Python 3.10 and above, and provide informative error messages for unsupported versions.

* Updated run script to check for Python 3.10 and above, and provide informative error messages for unsupported versions.

---------

Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
2023-05-16 08:14:24 -07:00

29 lines
728 B
Bash
Executable File

#!/bin/bash
function find_python_command() {
if command -v python &> /dev/null
then
echo "python"
elif command -v python3 &> /dev/null
then
echo "python3"
else
echo "Python not found. Please install Python."
exit 1
fi
}
PYTHON_CMD=$(find_python_command)
if $PYTHON_CMD -c "import sys; sys.exit(sys.version_info < (3, 10))"; then
$PYTHON_CMD scripts/check_requirements.py requirements.txt
if [ $? -eq 1 ]
then
echo Installing missing packages...
$PYTHON_CMD -m pip install -r requirements.txt
fi
$PYTHON_CMD -m autogpt $@
read -p "Press any key to continue..."
else
echo "Python 3.10 or higher is required to run Auto GPT."
fi