Spaces:
Sleeping
Sleeping
Upload setup.sh
Browse files
setup.sh
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
echo -e "\e[0;32m[INFO]\e[0m Installing virtualenv package..." &&
|
3 |
+
sudo apt-get install -y python3.10-venv &&
|
4 |
+
echo -e "\e[0;32m[INFO]\e[0m Creating virtual environment..." &&
|
5 |
+
python3 -m venv ./env &&
|
6 |
+
echo -e "\e[0;32m[INFO]\e[0m Activating virtual environment..." &&
|
7 |
+
source env/bin/activate &&
|
8 |
+
echo `which python3` &&
|
9 |
+
if [ -f "requirements.txt" ]; then
|
10 |
+
pip install wheel &&
|
11 |
+
echo -e "\e[0;32m[INFO]\e[0m Installing python packages from requirements.txt..." &&
|
12 |
+
pip install -r requirements.txt
|
13 |
+
else
|
14 |
+
echo -e "\e[0;33m[WARNING]\e[0m Not found: requirements.txt. Skipping python packages installation."
|
15 |
+
fi &&
|
16 |
+
if [ -f "packages.txt" ]; then
|
17 |
+
echo -e "\e[0;32m[INFO]\e[0m Installing apt packages from packages.txt..." &&
|
18 |
+
sed 's/#.*//' packages.txt | xargs sudo apt-get install -y
|
19 |
+
else
|
20 |
+
echo -e "\e[0;33m[WARNING]\e[0m Not found: packages.txt. Skipping apt packages installation."
|
21 |
+
fi &&
|
22 |
+
echo -e "\e[0;32m[INFO]\e[0m Done!"
|