-
Notifications
You must be signed in to change notification settings - Fork 5
/
ubuntu_datascience_env.sh
executable file
·135 lines (118 loc) · 3.5 KB
/
ubuntu_datascience_env.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/bin/bash
git="git"
gStreamer="libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc
gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-pulseaudio"
python2="python-dev"
pip2="python-pip"
python3="python3-dev"
pip3="python3-pip"
virtEnv="virtualenv"
future="future"
Jupyter="jupyter"
function configureGit()
{
echo "##### Configure Git"
read -r -p "Enter Git User Name:" userName
git config --global user.name $userName
read -r -p "Enter GIT Email ID:" EmailID
git config --global user.email $EmailID
echo "Git configuration Detail:"
git config --list
}
function systemBasicUpdate()
{
echo "#### Basic ubuntu update"
# Update the apt package index and Upgrade the Ubuntu system
sudo apt-get update && sudo apt-get -y upgrade
#Install Git
echo "#### Install Git"
for pkg in $git; do
if dpkg --get-selections | grep -q "^$pkg[[:space:]]*install$" >/dev/null; then
echo -e "$pkg is already installed"
else
if sudo apt-get -qq install $pkg; then
echo "Successfully installed $pkg"
else
echo "Error installing $pkg"
fi
fi
done
read -r -p "Do you wanna configure git?[Y/N]" response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]
then
configureGit
else
echo "Assume you have done the Git configuration already"
fi
#Install Gstreamer
echo "#### Install Gstreamer"
for pkg in $gStreamer; do
if dpkg --get-selections | grep -q "^$pkg[[:space:]]*install$" >/dev/null; then
echo -e "$pkg is already installed"
else
if sudo apt-get -qq install $pkg; then
echo "Successfully installed $pkg"
else
echo "Error installing $pkg"
fi
fi
done
}
function installAptPackage()
{
for pkg in $1; do
if dpkg --get-selections | grep -q "^$pkg[[:space:]]*install$" >/dev/null; then
echo -e "$pkg is already installed"
else
if sudo apt-get -qq install $pkg; then
echo "Successfully installed $pkg"
else
echo "Error installing $pkg"
fi
fi
done
}
function installPipPackage()
{
echo "$1"
echo "$2"
if [ "$1" == "2" ];
then
pip install $2 --user
else
pip3 install $2 --user
fi
}
#MainStarts Here
systemBasicUpdate
read -r -p "Which Python Version You wanna use?[2/3.7]" response
if [ "$response" == "3" ]
then
echo "Using Python 3 Version"
#Install Python2 Package
installAptPackage ${python2}
#Install Python2 pip package manager
installAptPackage ${pip2}
#Install virtualenv Pip package
installPipPackage $response ${virtEnv}
#Install future: Fix:how-to-solve-readtimeouterror-httpsconnectionpoolhost-pypi-python-org-port
installPipPackage $response ${future}
else
echo "Using Python 2 Version"
#Install Python3 Package
installAptPackage ${python3}
#Install Python3 pip package manager
installAptPackage ${pip3}
#Install virtualenv Pip package
installPipPackage $response ${virtEnv}
#Install future: Fix:how-to-solve-readtimeouterror-httpsconnectionpoolhost-pypi-python-org-port
installPipPackage $response ${future}
fi
read -r -p "Do you wanna Install Jupyter Notebook?[Y/N]" jupterNotebook
if [[ "$jupterNotebook" =~ ^([yY][eE][sS]|[yY])+$ ]]
then
installAptPackage "ipython"
installAptPackage "ipython-notebook"
installPipPackage $response ${Jupyter}
fi