-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
38 lines (29 loc) · 1 KB
/
install.sh
File metadata and controls
38 lines (29 loc) · 1 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
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Function to print error messages
error() {
echo "Error: $1" >&2
exit 1
}
# Check if Python is installed
if ! command -v python3 &> /dev/null; then
error "Python 3 is not installed. Please install Python 3.7 or higher."
fi
# Create virtual environment
echo "Creating virtual environment..."
python3 -m venv venv || error "Failed to create virtual environment"
# Activate virtual environment
echo "Activating virtual environment..."
source venv/bin/activate || error "Failed to activate virtual environment"
# Upgrade pip
echo "Upgrading pip..."
pip install --upgrade pip || error "Failed to upgrade pip"
pip install -U pip setuptools wheel
# Install Python dependencies
echo "Installing Python dependencies..."
pip install -r requirements.txt || error "Failed to install Python dependencies"
echo "Installation completed successfully!"
echo "To start the application, run:"
echo "source venv/bin/activate"
echo "python app.py"