-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_python.bat
More file actions
33 lines (27 loc) · 852 Bytes
/
install_python.bat
File metadata and controls
33 lines (27 loc) · 852 Bytes
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
@echo off
setlocal
echo [1/4] Downloading Python 3.11.9 (64-bit) installer
set "PYTHON_URL=https://www.python.org/ftp/python/3.11.9/python-3.11.9-amd64.exe"
set "PYTHON_INSTALLER=%TEMP%\python-3.11.9-amd64.exe"
curl -L -o "%PYTHON_INSTALLER%" "%PYTHON_URL%"
if errorlevel 1 (
echo [ERROR] Failed to download Python 3.11.9 installer
exit /b 1
)
echo [2/4] Running silent install for current user
"%PYTHON_INSTALLER%" /quiet InstallAllUsers=0 PrependPath=1 Include_test=0
if errorlevel 1 (
echo [ERROR] Python installation failed
exit /b 1
)
echo [3/4] Verifying installation
where python >nul 2>&1
if errorlevel 1 (
echo [ERROR] Python installation did not succeed
exit /b 1
)
echo [4/4] Python 3.11.9 installed successfully and added to PATH
python --version
echo Done.
endlocal
exit /b 0