From a7e2fea1ba2f40fca78ba8823e81c42e7a234314 Mon Sep 17 00:00:00 2001 From: Alphaeus Mote Date: Fri, 24 Oct 2025 12:55:28 -0400 Subject: [PATCH] Add Python installation detection and Windows-specific instructions DEPLOY SCRIPT IMPROVEMENTS: - Added explicit Python availability check before CSV generation - Supports both python3 and python commands (Windows uses 'python') - Clear error message if Python is not installed - Windows-specific installation instructions with Microsoft Store option - Linux/macOS instructions to run dependency installer - Prevents silent failures when Python is missing DEPENDENCY INSTALLER ENHANCEMENTS: - Enhanced Windows section with detailed installation steps - Added Microsoft Store option (easiest for Windows users) - Added official Python installer option with PATH checkbox reminder - Clear verification command: python --version - Instructions to close/reopen PowerShell after installation PROBLEM SOLVED: - CSV import was showing 0 rows because Python script never ran - Python not installed on Windows by default - Script failed silently without clear error message - Users now get clear instructions on how to install Python NEXT STEPS FOR USERS: 1. Install Python 3 from Microsoft Store or python.org 2. Close and reopen PowerShell 3. Run ./deploy.sh again 4. CSV generation will work and data will persist --- deploy.sh | 29 ++++++++++++++++++++++++++++- scripts/install-dependencies.sh | 24 ++++++++++++++++++++---- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/deploy.sh b/deploy.sh index 4aeb09e..9d26258 100644 --- a/deploy.sh +++ b/deploy.sh @@ -195,9 +195,36 @@ echo "" # Generate CSV files using Python echo -e "${CYAN}Generating CSV files...${NC}" -python3 scripts/generate_csv_data.py + +# Check if Python is available +if ! command -v python3 >/dev/null 2>&1 && ! command -v python >/dev/null 2>&1; then + echo -e "${RED}✗ Python 3 is not installed${NC}" + echo "" + echo -e "${YELLOW}Python 3 is required for CSV data generation.${NC}" + echo "" + echo -e "${CYAN}On Windows:${NC}" + echo -e " 1. Open Microsoft Store and search for 'Python 3.12'" + echo -e " 2. Or download from: ${GREEN}https://www.python.org/downloads/${NC}" + echo -e " 3. Make sure to check 'Add Python to PATH' during installation" + echo -e " 4. Close and reopen PowerShell" + echo -e " 5. Re-run: ${GREEN}./deploy.sh${NC}" + echo "" + echo -e "${CYAN}On Linux/macOS:${NC}" + echo -e " Run: ${GREEN}./scripts/install-dependencies.sh${NC}" + echo "" + exit 1 +fi + +# Try python3 first, fall back to python +if command -v python3 >/dev/null 2>&1; then + python3 scripts/generate_csv_data.py +else + python scripts/generate_csv_data.py +fi + if [ $? -ne 0 ]; then echo -e "${RED}✗ CSV generation failed${NC}" + echo -e "${YELLOW}Check the error message above for details${NC}" exit 1 fi diff --git a/scripts/install-dependencies.sh b/scripts/install-dependencies.sh index be6bf63..ea1310f 100644 --- a/scripts/install-dependencies.sh +++ b/scripts/install-dependencies.sh @@ -81,10 +81,26 @@ install_python() { fi ;; windows) - echo -e "${YELLOW}On Windows, please install Python 3 manually:${NC}" - echo -e " 1. Download from: https://www.python.org/downloads/" - echo -e " 2. Or use WSL2 with Ubuntu" - echo -e " 3. Make sure to check 'Add Python to PATH' during installation" + echo -e "${YELLOW}⚠ Windows detected - Python 3 installation required${NC}" + echo "" + echo -e "${CYAN}Option 1: Microsoft Store (Easiest)${NC}" + echo -e " 1. Open Microsoft Store" + echo -e " 2. Search for 'Python 3.12' or 'Python 3.11'" + echo -e " 3. Click 'Get' or 'Install'" + echo -e " 4. Close and reopen PowerShell" + echo "" + echo -e "${CYAN}Option 2: Official Installer${NC}" + echo -e " 1. Visit: ${GREEN}https://www.python.org/downloads/${NC}" + echo -e " 2. Download Python 3.12 or later" + echo -e " 3. Run installer" + echo -e " 4. ✅ CHECK 'Add Python to PATH' during installation" + echo -e " 5. Close and reopen PowerShell" + echo "" + echo -e "${CYAN}After installation, verify:${NC}" + echo -e " ${GREEN}python --version${NC} (should show Python 3.x.x)" + echo "" + echo -e "${YELLOW}Then re-run: ./deploy.sh${NC}" + echo "" exit 1 ;; *)