install_pip: don't fail when not installed
On some platforms, "python -m pip" isn't available. Currently this is
run undconditionally from the "get_versions" function; remove the call.
Change-Id: I91d6c66d055f02fa7b4368593b629933f82d8117
diff --git a/tools/install_pip.sh b/tools/install_pip.sh
index 0082e9f..eb0f6eb 100755
--- a/tools/install_pip.sh
+++ b/tools/install_pip.sh
@@ -46,15 +46,13 @@
function get_versions {
# FIXME(dhellmann): Deal with multiple python versions here? This
# is just used for reporting, so maybe not?
- PIP=$(which pip 2>/dev/null || which pip-python 2>/dev/null || true)
+ PIP=$(which pip 2>/dev/null || which pip-python 2>/dev/null || which pip3 2>/dev/null || true)
if [[ -n $PIP ]]; then
PIP_VERSION=$($PIP --version | awk '{ print $2}')
echo "pip: $PIP_VERSION"
else
echo "pip: Not Installed"
fi
- # Show python3 module version
- python${PYTHON3_VERSION} -m pip --version
}