Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

fix python version determining logic #1682

Benjamin King44a148853fc8
diff --git a/tasks/buildOptions.sh b/tasks/buildOptions.sh
index 6a2de6433..501b5d02e 100755
--- a/tasks/buildOptions.sh
+++ b/tasks/buildOptions.sh
@@ -9,13 +9,15 @@ OPT_DIR="$BASE/config/default"
BUILD_DIR="$BASE/build/options-build"
DEST_DIR="$BASE/build/options"
PYTHON_SCRIPTS_DIR="$TASKS_DIR/python2.7"
+PYTHON_VERSION="$(python -V 2>&1)"
+
# If there is an active directory, use instead of defaults
if [ -d "$BASE/config/active" ]; then
SRC_DIR="$BASE/config/active"
OPT_DIR="$BASE/config/active"
fi
-if command -v python3 &>/dev/null; then
+if [command -v python3 &>/dev/null] || [[ $PYTHON_VERSION = *"Python 3"* ]]; then
PYTHON_SCRIPTS_DIR="$TASKS_DIR/python3"
fi
# If $IGNORE_ERRORS is true, don't fail on errors
diff --git a/tasks/pythonInstall.sh b/tasks/pythonInstall.sh
index dd53b1da7..67437ee92 100755
--- a/tasks/pythonInstall.sh
+++ b/tasks/pythonInstall.sh
@@ -1,7 +1,8 @@
#!/bin/bash
# Install python dependencies
+PYTHON_VERSION="$(python -V 2>&1)"
if [ $1 = "linux" ]; then
- if command -v python3 &>/dev/null; then
+ if [command -v python3 &>/dev/null] || [[ $PYTHON_VERSION = *"Python 3"* ]]; then
echo "Installing virtualenv with python3"
python3 -m pip install --user virtualenv
python3 -m virtualenv .python
@@ -20,7 +21,7 @@ if [ $1 = "linux" ]; then
fi
else
# If is a window machine use virtualenv
- if command -v python3 &>/dev/null; then
+ if [command -v python3 &>/dev/null] || [[ $PYTHON_VERSION = *"Python 3"* ]]; then
virtualenv .python
PATH=.python/Scripts:${PATH} pip install -r requirements.txt
else