-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.bat
41 lines (30 loc) · 956 Bytes
/
install.bat
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
@echo off
:: Determine which python executable path alias to use
WHERE python >nul 2>nul
IF %ERRORLEVEL% == 0 goto :aliaspython
WHERE python3 >nul 2>nul
IF %ERRORLEVEL% == 0 goto :aliaspython3
WHERE py >nul 2>nul
IF %ERRORLEVEL% == 0 goto :aliaspy
echo "Sorry, Python could not be found!"
goto :end
:aliaspython
FOR /F "tokens=2" %%g IN ('python -V') do (SET version=%%g)
SET pyexec=python
goto :checkversion
:aliaspython3
FOR /F "tokens=2" %%g IN ('python3 -V') do (SET version=%%g)
SET pyexec=python3
goto :checkversion
:aliaspy
FOR /F "tokens=2" %%g IN ('py -V') do (SET version=%%g)
SET pyexec=py
:: Check a valid python version is installed (> 3.10.0)
:checkversion
IF (%version% GEQ "3.10.0") goto :install
echo You are running an invalid python version: Python %version%. Please use version 3.10.0 or greater.
goto :end
:: Upgrade pip and install required packages through PyPi
:install
%pyexec% -m pip install -U -r requirements.txt
:end