Skip to content

Commit 0d44cb2

Browse files
committed
check python and pip versions (#19)
1 parent a71ad73 commit 0d44cb2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

install.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ function install_software() {
6060
fi
6161
}
6262

63+
function check_python_version() {
64+
python3 -V | grep '3.[7-9].[0-9]' &> /dev/null
65+
if ! [ $? == 0 ]; then
66+
echo "An unsupported version of python 3 is installed. Must have python 3.7+ installed to use the Hologram SDK"
67+
exit 1
68+
fi
69+
}
70+
6371
# EFFECTS: Returns true if the specified program is installed, false otherwise.
6472
function check_if_installed() {
6573
if command -v "$*" >/dev/null 2>&1; then
@@ -99,6 +107,8 @@ function verify_installation() {
99107
echo 'You are now ready to use the Hologram Python SDK!'
100108
}
101109

110+
check_python_version
111+
102112
update_repository
103113

104114
# Iterate over all programs to see if they are installed
@@ -115,6 +125,11 @@ do
115125
pause "Installing $program. Press [Enter] key to continue...";
116126
install_software 'python3-pip'
117127
fi
128+
pip3 -V | grep '3.[7-9]' &> /dev/null
129+
if ! [ $? == 0 ]; then
130+
echo "pip3 is installed for an unsupported version of python."
131+
exit 1
132+
fi
118133
elif check_if_installed "$program"; then
119134
echo "$program is already installed."
120135
else

0 commit comments

Comments
 (0)