-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup_venv
35 lines (34 loc) · 918 Bytes
/
setup_venv
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
#!/bin/bash
# ===========================================================
# check if virtualenv exists and if not, create it
if [ -f "venv/bin/activate" ]
then
echo "virtual enviroment venv already exists"
else
echo "creating virtual enviroment venv"
python3 -m venv venv
if [ $? -ne 0 ]
then
echo "error creating virtual enviroment venv"
# exit /b $?
fi
fi
# ===========================================================
echo "activating venv"
source venv/bin/activate
if [ $? -ne 0 ]
then
echo "error activating virtual enviroment venv"
# exit /b $?
fi
# ===========================================================
echo "Installing required libraries in venv"
pip install -r requirements.txt
if [ $? -ne 0 ]
then
echo "error activating virtual enviroment venv"
# exit /b $?
else
echo "Succeed in creacting venv"
echo "start project using run script"
fi