-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathenv_setup.sh
More file actions
35 lines (32 loc) · 1.12 KB
/
env_setup.sh
File metadata and controls
35 lines (32 loc) · 1.12 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
#!/bin/sh
# This script automates the creation of a Python virtual environment.
# use this your sys do not support a virtual machine
# you can follow installation process steps in description
if [ -d "virtualenv" ]; then
echo "Virtual environment 'virtualenv' found, activating it."
else
echo "Virtual environment not found, creating new 'virtualenv'."
python3 -m venv virtualenv
if [ $? -eq 0 ]; then
echo "Virtual environment was successfully created."
else
echo "Virtual environment was NOT created, aborting."
exit 1
fi
fi
source virtualenv/bin/activate
if [ $? -eq 0 ]; then
echo "Virtual environment is successfully activated."
else
echo "Virtual environment was NOT activated, aborting."
exit 1
fi
echo "Installing required packages."
pip3 install -r requirements.txt # After installing the virtual package install requirements.txt file to install access requirements to run this on virtual env
if [ $? -eq 0 ]; then
echo "All requirements were successfully installed."
else
echo "Requirements were NOT installed properly, aborting."
exit 1
fi
echo "Done."