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() {
5757 fi
5858}
5959
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+
6067# EFFECTS: Returns true if the specified program is installed, false otherwise.
6168function check_if_installed() {
6269 if command -v " $* " > /dev/null 2>&1 ; then
@@ -96,10 +103,12 @@ function verify_installation() {
96103 echo ' You are now ready to use the Hologram Python SDK!'
97104}
98105
106+ check_python_version
107+
99108update_repository
100109
101110# 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
103112 echo " Found a previous version of the SDK on Python 2. The new update uses"
104113 echo " Python 3 and is not compatible with Python 2. This script will uninstall"
105114 echo " the previous SDK version, install Python 3 and then install the new"
123132 pause " Installing $program . Press [Enter] key to continue..." ;
124133 install_software ' python3-pip'
125134 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
126139 elif check_if_installed " $program " ; then
127140 echo " $program is already installed."
128141 else
You can’t perform that action at this time.
0 commit comments