-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython-installs.sh
More file actions
111 lines (87 loc) · 2.47 KB
/
python-installs.sh
File metadata and controls
111 lines (87 loc) · 2.47 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
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
#!/usr/bin/env bash
# Things to download
essentials=("numpy" "pandas" "matplotlib" "seaborn" "jupyter" "PyPDF2" "requests" "pytest" "cython")
machine_learning=("sklearn" "transformers" "datasets" "evaluate" "torchmetrics" "tqdm")
natural_language_processing=("nltk" "bs4" "jiwer" "gensim")
wave_files=("wave" "PyDub" "simpleaudio")
display_package_sets() {
echo ""
echo "==============================================================="
echo " Python Package Sets "
echo "==============================================================="
echo "essentials: ${essentials[@]}"
echo "machine learning: ${machine_learning[@]}"
echo "natural-language processing: ${natural_language_processing[@]}"
echo "wave file: ${wave_files[@]}"
echo "==============================================================="
echo ""
}
download() {
# Gets all variables as array
arr=($@)
# Get the python installation for the current shell
path=`which python`
echo "PATH: ${path}"
for package in ${arr[@]}
do
"${path}python -m pip install ${package}"
done
}
# Program start
echo "Standard Python Installations"
option="-1"
while [ ${option} == "-1" ]
do
echo "Please select which libraries to install:"
echo " all groups: 1"
echo " essentials: 2"
echo " machine learning: 3"
echo " natual-language processing: 4"
echo " wave files: 5"
echo "Type \"list\" to view details for each package and \"exit\" to quit."
# Get user input
read option
if [ ${option} == "list" ]
then
display_package_sets
option="-1"
elif [ ${option} == "exit" ]
then
exit
elif (( ${option} >= 1 && ${option} <= 5 ))
then
if (( ${option} == 1 ))
then
echo "Downloading ALL package sets:"
else
echo "Downloading option ${option}"
fi
read -p "Are you sure? [y/n]: " opt
if [ ${opt} == "y" ] || [ ${opt} == "Y" ]
then
if (( ${option} == 2 || ${option} == 1 )); then
download ${essentials[@]}
fi
if (( ${option} == 3 || ${option} == 1 )); then
download ${machine_learning[@]}
fi
if (( ${option} == 4 || ${option} == 1 )); then
download ${natural_language_processing[@]}
fi
if ((${option} == 5 || ${option} == 1)); then
download ${wave_files[@]}
fi
exit
elif [ ${opt} == "n" ] || [ ${opt} == "N" ]
then
echo "TERMINATING..."
exit
else
echo "INVALID OPTION, RETURNING TO MAIN MENU"
option="-1"
fi
else
echo "INVALID OPTION, PLEASE TRY AGAIN!"
option="-1"
fi
done