-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
58 lines (51 loc) · 1.37 KB
/
Copy pathsetup.bat
File metadata and controls
58 lines (51 loc) · 1.37 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
@echo off
:: Verificar si el entorno virtual ya existe
if exist .venv (
echo El entorno virtual ya existe. Activando...
) else (
echo Creando el entorno virtual...
python -m venv .venv
if %ERRORLEVEL% neq 0 (
echo Error: No se pudo crear el entorno virtual.
pause
exit /b 1
)
)
echo Activando el entorno virtual...
call .venv\Scripts\activate
if %ERRORLEVEL% neq 0 (
echo Error: No se pudo activar el entorno virtual.
pause
exit /b 1
)
:: Verificar si el archivo requirements.txt existe
if not exist .\assets\requirements.txt (
echo Error: No se encontró el archivo requirements.txt en la carpeta 'assets'.
deactivate
pause
exit /b 1
)
echo Instalando dependencias...
pip install -r .\assets\requirements.txt
if %ERRORLEVEL% neq 0 (
echo Error: No se pudieron instalar las dependencias.
deactivate
pause
exit /b 1
)
:: Ejecutar el script main.py
echo Ejecutando el script main.py...
python .\main.py
if %ERRORLEVEL% neq 0 (
echo Error: No se pudo ejecutar main.py.
deactivate
pause
exit /b 1
)
:: Desactivar el entorno virtual
echo Desactivando el entorno virtual...
deactivate
:: Indicar que todo se ejecutó correctamente
echo El entorno virtual ha sido creado, las dependencias han sido instaladas, y el script main.py ha sido ejecutado correctamente.
:: Mantener la ventana abierta
pause