Spaces:
Running
Running
File size: 3,437 Bytes
e961681 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | @echo off
setlocal enabledelayedexpansion
REM Quick test for PowerShell and uv installation
echo ========================================
echo Quick Environment Test
echo ========================================
echo.
REM Test 1: Check PowerShell
echo [Test 1] Checking PowerShell...
powershell -Command "Write-Host 'PowerShell is available' -ForegroundColor Green; Write-Host 'Version:'; $PSVersionTable.PSVersion" 2>nul
if !ERRORLEVEL! EQU 0 (
echo [PASS] PowerShell is working
) else (
echo [FAIL] PowerShell not available
)
echo.
REM Test 2: Check winget
echo [Test 2] Checking winget...
where winget >nul 2>&1
if !ERRORLEVEL! EQU 0 (
echo [PASS] winget found
winget --version
) else (
echo [INFO] winget not found
echo Note: winget is available on Windows 10 1809+ and Windows 11
)
echo.
REM Test 3: Check python_embeded
echo [Test 3] Checking python_embeded...
if exist "%~dp0python_embeded\python.exe" (
echo [PASS] python_embeded found
"%~dp0python_embeded\python.exe" --version
) else (
echo [INFO] python_embeded not found
)
echo.
REM Test 4: Check uv
echo [Test 4] Checking uv...
where uv >nul 2>&1
if !ERRORLEVEL! EQU 0 (
echo [PASS] uv found in PATH
uv --version
) else (
echo [INFO] uv not found in PATH
if exist "%USERPROFILE%\.local\bin\uv.exe" (
echo [INFO] But uv.exe exists at: %USERPROFILE%\.local\bin\uv.exe
"%USERPROFILE%\.local\bin\uv.exe" --version
) else (
if exist "%LOCALAPPDATA%\Microsoft\WinGet\Links\uv.exe" (
echo [INFO] But uv.exe exists at: %LOCALAPPDATA%\Microsoft\WinGet\Links\uv.exe
"%LOCALAPPDATA%\Microsoft\WinGet\Links\uv.exe" --version
) else (
echo [INFO] uv not installed
)
)
)
echo.
REM Test 5: Test internet connectivity
echo [Test 5] Testing internet connectivity...
powershell -NoProfile -Command "try { $null = Invoke-WebRequest -Uri 'https://astral.sh' -UseBasicParsing -TimeoutSec 5; Write-Host '[PASS] Can access astral.sh' -ForegroundColor Green } catch { Write-Host '[FAIL] Cannot access astral.sh' -ForegroundColor Red; Write-Host 'Error:' $_.Exception.Message }"
echo.
REM Summary
echo ========================================
echo Summary
echo ========================================
echo.
REM Determine which environment will be used
set ENV_FOUND=0
if exist "%~dp0python_embeded\python.exe" (
echo [RESULT] Will use: python_embeded
echo No additional setup needed!
set ENV_FOUND=1
)
if !ENV_FOUND! EQU 0 (
where uv >nul 2>&1
if !ERRORLEVEL! EQU 0 (
echo [RESULT] Will use: uv ^(from PATH^)
echo No additional setup needed!
set ENV_FOUND=1
)
)
if !ENV_FOUND! EQU 0 (
if exist "%USERPROFILE%\.local\bin\uv.exe" (
echo [RESULT] Will use: uv ^(not in PATH^)
echo Action: Add to PATH or restart terminal
set ENV_FOUND=1
)
)
if !ENV_FOUND! EQU 0 (
if exist "%LOCALAPPDATA%\Microsoft\WinGet\Links\uv.exe" (
echo [RESULT] Will use: uv ^(not in PATH^)
echo Action: Add to PATH or restart terminal
set ENV_FOUND=1
)
)
if !ENV_FOUND! EQU 0 (
echo [RESULT] No environment found
echo Action: Run start_gradio_ui.bat to install uv
echo Or: Download portable package
)
echo.
echo ========================================
echo Press any key to close...
echo ========================================
pause >nul
endlocal
|