-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·32 lines (26 loc) · 911 Bytes
/
Copy pathsetup.sh
File metadata and controls
executable file
·32 lines (26 loc) · 911 Bytes
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
#!/bin/bash
# Nombre del entorno virtual
VENV_DIR="venv"
# Archivo de requirements
REQUIREMENTS_FILE="requirements.txt"
# Verifica si el entorno virtual ya existe
if [ -d "$VENV_DIR" ]; then
echo "El entorno virtual '$VENV_DIR' ya existe."
else
# Crear el entorno virtual
echo "Creando el entorno virtual en '$VENV_DIR'..."
python3 -m venv "$VENV_DIR"
echo "Entorno virtual creado."
fi
# Activar el entorno virtual
echo "Activando el entorno virtual..."
source "$VENV_DIR/bin/activate"
# Verificar si el archivo requirements.txt existe
if [ -f "$REQUIREMENTS_FILE" ]; then
echo "Instalando los paquetes desde '$REQUIREMENTS_FILE'..."
pip install -r "$REQUIREMENTS_FILE"
echo "Paquetes instalados correctamente."
else
echo "No se encontró el archivo '$REQUIREMENTS_FILE'."
fi
echo "Entorno listo. Recuerda usar 'source $VENV_DIR/bin/activate' para activar tu entorno."