From a306792de96e69d29f231ddcb6534048b7e2489e Mon Sep 17 00:00:00 2001 From: Brandon Macer Date: Tue, 22 Oct 2024 20:48:43 -0400 Subject: [PATCH] check python minor version (#62) --- computer-use-demo/setup.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/computer-use-demo/setup.sh b/computer-use-demo/setup.sh index 3185f1c2..bd966cae 100755 --- a/computer-use-demo/setup.sh +++ b/computer-use-demo/setup.sh @@ -1,4 +1,13 @@ #!/bin/bash +PYTHON_MINOR_VERSION=$(python3 --version | awk -F. '{print $2}') + +if [ "$PYTHON_MINOR_VERSION" -gt 12 ]; then + echo "Python version 3.$PYTHON_MINOR_VERSION detected. Python 3.12 or lower is required for setup to complete." + echo "If you have multiple versions of Python installed, you can set the correct one by adjusting setup.sh to use a specific version, for example:" + echo "'python3 -m venv .venv' -> 'python3.12 -m venv .venv'" + exit 1 +fi + if ! command -v cargo &> /dev/null; then echo "Cargo (the package manager for Rust) is not present. This is required for one of this module's dependencies." echo "See https://www.rust-lang.org/tools/install for installation instructions."