File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,13 @@ function install_software() {
57
57
fi
58
58
}
59
59
60
+ function check_python_version() {
61
+ if ! python3 -V | grep ' 3.[7-9].[0-9]' > /dev/null 2>&1 ; then
62
+ echo " An unsupported version of python 3 is installed. Must have python 3.7+ installed to use the Hologram SDK"
63
+ exit 1
64
+ fi
65
+ }
66
+
60
67
# EFFECTS: Returns true if the specified program is installed, false otherwise.
61
68
function check_if_installed() {
62
69
if command -v " $* " > /dev/null 2>&1 ; then
@@ -96,10 +103,12 @@ function verify_installation() {
96
103
echo ' You are now ready to use the Hologram Python SDK!'
97
104
}
98
105
106
+ check_python_version
107
+
99
108
update_repository
100
109
101
110
# Check if an older version exists and uninstall it
102
- if command hologram version | grep ' 0.8 ' ; then
111
+ if command hologram version | grep ' 0.[0-8] ' ; then
103
112
echo " Found a previous version of the SDK on Python 2. The new update uses"
104
113
echo " Python 3 and is not compatible with Python 2. This script will uninstall"
105
114
echo " the previous SDK version, install Python 3 and then install the new"
123
132
pause " Installing $program . Press [Enter] key to continue..." ;
124
133
install_software ' python3-pip'
125
134
fi
135
+ if ! pip3 -V | grep ' 3.[7-9]' > /dev/null 2>&1 ; then
136
+ echo " pip3 is installed for an unsupported version of python."
137
+ exit 1
138
+ fi
126
139
elif check_if_installed " $program " ; then
127
140
echo " $program is already installed."
128
141
else
You can’t perform that action at this time.
0 commit comments