-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
36 lines (29 loc) · 1004 Bytes
/
setup.sh
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
#!/bin/bash
# Define the name of the virtual environment
VENV_NAME="jtk"
# Check if Python3 is installed
if ! command -v python3 &> /dev/null; then
echo "Error: Python3 is not installed. Please install it first."
exit 1
fi
# Check if virtualenv is installed
if ! command -v virtualenv &> /dev/null; then
echo "Error: virtualenv is not installed. Please install it first."
exit 1
fi
# Check if the virtual environment already exists
if [ -d "$VENV_NAME" ]; then
echo "Error: Virtual environment '$VENV_NAME' already exists."
exit 1
fi
# Create a virtual environment
echo "Creating virtual environment................"
python3 -m venv $VENV_NAME
# Activate the virtual environment
echo "Activating virtual environment................"
source $VENV_NAME/bin/activate
# Install dependencies from requirements.txt
echo "Installing requirements................"
pip install --upgrade pip
pip install -r requirements.txt
echo "Virtual environment '$VENV_NAME' setup is complete."