Commit bce53187 authored by 邱阿朋's avatar 邱阿朋

更新 '初始化.bat'

parent 11aced2c
@echo off
setlocal
set "current_dir=%~dp0"
set "source=%current_dir%Python"
set "target=D:\app"
if not exist "%target%" (
mkdir "%target%"
)
:: 设置 Python 下载链接和目标安装目录
set "PYTHON_VERSION=3.10.10"
set "PYTHON_INSTALLER=python-%PYTHON_VERSION%-amd64.exe"
set "TARGET_DIR=D:\app\Python"
move "%source%" "%target%"
:: 下载 Python 安装程序
echo Downloading Python %PYTHON_VERSION%...
powershell -Command "Invoke-WebRequest -Uri https://www.python.org/ftp/python/%PYTHON_VERSION%/%PYTHON_INSTALLER% -OutFile %PYTHON_INSTALLER%"
endlocal
:: 静默安装 Python
echo Installing Python...
start /wait %PYTHON_INSTALLER% /quiet InstallAllUsers=1 PrependPath=1 TargetDir="%TARGET_DIR%"
:: 清理下载的安装程序
echo Cleaning up...
del %PYTHON_INSTALLER%
D:\app\Python\python.exe --version
echo Python %PYTHON_VERSION% has been installed to %TARGET_DIR%.
D:\app\Python\Scripts\pip.exe install --no-warn-script-location -i https://mirrors.cloud.tencent.com/pypi/simple -r requirements.txt
:: 检查 Python 版本
"%TARGET_DIR%\python.exe" --version
echo Installing required packages...
:: "%TARGET_DIR%\pip.exe" install --no-warn-script-location -i https://mirrors.cloud.tencent.com/pypi/simple -r requirements.txt
endlocal
pause
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment