-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_linux.sh
59 lines (45 loc) · 1.74 KB
/
install_linux.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# Unused, but kept for reference
# Check for Ubuntu 20, 22 or WSL2
#if ! (lsb_release -a 2>/dev/null | grep -E "Ubuntu 20|Ubuntu 22" || grep -q Microsoft /proc/version); then
# echo "Unsupported system! This script is for Ubuntu 20, Ubuntu 22, and WSL2 with Ubuntu."
# exit 1
#fi
# Install prerequisites
echo "Installing prerequisites..."
sudo apt update
sudo apt install -y libopenblas-dev nodejs npm python3.8 python3-pip python3-venv
# Check for Node.js and npm
if ! (node -v && npm -v) > /dev/null; then
echo "Error: Node.js and npm are required!"
exit 1
fi
# Frontend installation
echo "Installing frontend dependencies..."
cd parameterizer_frontend
npm install
# To start the frontend development server, uncomment the line below
# npm run dev
# Navigate back to root directory
cd ..
# Backend installation
echo "Setting up backend environment..."
cd timeSeriesImputerParameterizer
# Extract the Python 3 minor version number
PYTHON3_MINOR_VERSION=$(python3 --version | awk '{print $2}' | cut -d'.' -f2)
# Install the appropriate venv module
sudo apt install -y python3.${PYTHON3_MINOR_VERSION}-venv
# Create virtual environment (if not already created)
if [ ! -d "env" ]; then
python3 -m venv env
source env/bin/activate
fi
# Install Django and other dependencies
pip install -r requirements.txt
# To start the backend development server, uncomment the line below
# python manage.py runserver
echo "Installation complete!"
# Note: The 'npm run dev' and 'python manage.py runserver' commands are commented out,
# so they won't be executed by the script.
# You can uncomment them if you want the servers to start right after the installation.
# If you do so, you will need to open a new terminal window to run the other command.