diff --git a/scripts/run.sh b/scripts/run.sh index ea59065..1f93f9f 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -2,6 +2,24 @@ # Exit immediately if a command exits with a non-zero status. set -e +# --- Prerequisite check for python3-venv --- +echo "Checking for Python venv module..." +if ! python3 -c 'import venv' &> /dev/null; then + echo "Python 'venv' module is missing. It's required to create a virtual environment for the backend." + + # Attempt to provide specific installation instructions + if command -v apt &> /dev/null; then + PY_VERSION_SHORT=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') + echo "It seems you are on a Debian/Ubuntu-based system. Please install the venv module by running:" + echo "sudo apt update && sudo apt install python${PY_VERSION_SHORT}-venv" + else + echo "Please install the Python 'venv' module for your system." + fi + + exit 1 +fi +echo "Python venv module found." + # --- Backend Setup --- echo "Setting up backend..." cd backend