-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_ts.bat
More file actions
68 lines (59 loc) · 1.83 KB
/
install_ts.bat
File metadata and controls
68 lines (59 loc) · 1.83 KB
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
@echo off
rem Check if Python is installed and on path
where python >nul 2>nul
if %errorlevel% equ 0 (
set PYTHON_COMMAND=python
) else (
where python3 >nul 2>nul
if %errorlevel% equ 0 (
set PYTHON_COMMAND=python3
) else (
echo Python is not installed or not on path.
exit /b
)
)
echo %PYTHON_COMMAND% is installed and on path.
rem Check if virtual environment exists
if exist "ml_grid_ts_env" (
echo ml_grid_ts_env folder exists in the current directory.
) else (
echo ml_grid_ts_env folder does not exist in the current directory.
echo Creating ml_grid_ts_env folder...
rem Create virtual environment
%PYTHON_COMMAND% -m venv ml_grid_ts_env
if %errorlevel% neq 0 (
echo Failed to create virtual environment. Exiting...
exit /b
)
echo ml_grid_ts_env folder created.
)
rem Activate virtual environment
echo Activating virtual environment...
call ml_grid_ts_env\Scripts\activate.bat
if errorlevel 1 (
echo ERROR: Failed to activate virtual environment. Exiting.
exit /b
)
echo Virtual environment activated.
rem Upgrade pip
echo Upgrading pip...
call ml_grid_ts_env\Scripts\python.exe -m pip install --upgrade pip setuptools wheel
if errorlevel 1 (
echo ERROR: Failed to upgrade pip. Exiting.
exit /b
)
rem Install the project in editable mode with time-series and testing dependencies
echo Installing project dependencies...
call ml_grid_ts_env\Scripts\python.exe -m pip install -e .[test,ts]
if errorlevel 1 (
echo ERROR: Failed to install project dependencies. Exiting.
exit /b
)
rem Add kernel spec
echo Adding Jupyter kernel spec...
call ml_grid_ts_env\Scripts\python.exe -m ipykernel install --user --name=ml_grid_ts_env
rem Deactivate virtual environment
echo Deactivating virtual environment...
deactivate
echo All operations completed.
exit /b