-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall_v_e_wrapper.sh
executable file
·40 lines (32 loc) · 1.23 KB
/
install_v_e_wrapper.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
#! /bin/bash
# We need sudo to do some stuff
if [[ $EUID -ne 0 ]]; then
echo "Please run as root."
exit 1
fi
echo "=================================================================="
echo "================ Installing VirtualEnvWrapper ===================="
echo "=================================================================="
# Install PIP
if [ ! -f /usr/local/bin/pip ]; then
wget -O /tmp/get-pip.py "https://bootstrap.pypa.io/get-pip.py"
python3 /tmp/get-pip.py
fi
# Install virtualenv
if [ -f /usr/local/bin/pip ] && [ ! -f /usr/local/bin/virtualenv ]; then
pip install virtualenv
fi
# Install virtualenvwrapper
if [ -f /usr/local/bin/pip ] && [ ! -f /usr/local/bin/virtualenvwrapper.sh ]; then
pip install virtualenvwrapper
fi
# Add to shell startup file
echo "" >> ~/.bashrc
echo "export WORKON_HOME=~/.virtualenvs" >> ~/.bashrc
echo "export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3" >> ~/.bashrc
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
# Update shell
source ~/.bashrc
echo "=================================================================="
echo "============ Finished installing VirtualEnvWrapper ==============="
echo "=================================================================="