-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPythonSetup.bat
77 lines (64 loc) · 2.23 KB
/
PythonSetup.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
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
@echo off
setlocal enabledelayedexpansion
REM ���̽� �ٿ�ε� URL �� ���� �̸�
set "python_url=https://www.python.org/ftp/python/3.8.6/python-3.8.6-amd64.exe"
set "python_installer=python-3.8.6-amd64.exe"
REM ��ġ ���丮 ����
set "install_dir=C:\Python38"
set "PythonPath=C:\Python38\"
set "PythonScriptPath=C:\Python38\Scripts\"
set "NewPath=%PythonScriptPath%;%PythonPath%;"
set "PythonV=1"
set "Check=1"
REM ���̽��� ��ġ�Ǿ� �ִ°�
where python > nul 2>&1
if !errorlevel! equ 0 (
python -c "import sys; exit(0) if sys.version.startswith('3.8') else exit(1)" > nul 2>&1
if !errorlevel! equ 0 (
echo ���̽� 3.8 ������ �̹� ��ġ�Ǿ� �ֽ��ϴ�.
set "PythonV=0"
)
)
REM ���̽� ��ġ
REM �� ���⸦ ����
if !PythonV! equ 1 (
REM ���̽� ��ġ ���丮�� ������ ����
if not exist "!install_dir!" mkdir "!install_dir!"
REM ���̽� ��ġ ���� �ٿ�ε�
echo �ٿ�ε� ��: !python_url!
curl -o !install_dir!\!python_installer! !python_url!
echo �ٿ�ε� �Ϸ�, ��ġ ����
REM ���̽� ��ġ ����
start /wait !install_dir!\!python_installer! /quiet TargetDir=!install_dir!
if !errorlevel! equ 0 (
echo ���̽� 3.8 ���� ��ġ�� �Ϸ�Ǿ����ϴ�.
) else (
echo ���̽� 3.8 ���� ��ġ�� �����߽��ϴ�.
)
)
REM ȯ�� ���� ����
for %%i in ("!PATH:;=" "!") do (
set "Item=%%~i"
if "!Item!"=="!PythonPath!" (
echo !PythonPath!
set "Check=0"
)
if "!Item!"=="!PythonScriptPath!" (
echo !PythonScriptPath!
set "Check=0"
)
if !Check! equ 1 (
set "NewPath=!NewPath!;!Item!"
)
set "Check=1"
)
echo !NewPath!
REM ����� PATH ���� ����
setx PATH "%Newpath%" /m
echo ȯ�� ������ ���� ���� �߰��Ǿ����ϴ�.
python -m pip install --upgrade pip
pip install pillow==7.2
pip install folium
pip install staticmap
pause
endlocal