message: Py version retrieval.
diff: @@ -207,9 +207,6 @@ PYTHON_VER=$(lowercase "${TF_PYTHON_VERSION}")
  if [[ -z "$PYTHON_BIN_PATH" ]]; then
  die "Error: PYTHON_BIN_PATH was not provided. Did you run configure?"
  fi
  -# Get python version for configuring pip later in installation.
  -PYTHON_VER_CFG=$(${PYTHON_BIN_PATH} -V 2>&1 | awk '{print $2}' | cut -d. -f-2 | cut -c1-3)
  -echo "PYTHON_BIN_PATH: ${PYTHON_BIN_PATH} (version: ${PYTHON_VER_CFG})"
  # Default values for optional global variables in case they are not user
  # defined.
  @@ -239,15 +236,15 @@ PIP_WHL_DIR=$(realpath "${PIP_WHL_DIR}") # Get absolute path
  WHL_PATH=""
  # Determine the major.minor versions of python being used (e.g., 2.7).
  # Useful for determining the directory of the local pip installation.
  -PY_MAJOR_MINOR_VER=$(${PYTHON_BIN_PATH} -V 2>&1 | head -n 1 | awk '{print $2}' | cut -d. -f-2 | cut -c1-3)
  +PY_MAJOR_MINOR_VER=$(${PYTHON_BIN_PATH} -c "print(__import__('sys').version)" 2>&1 | awk '{ print $1 }' | head -n 1 | cut -c1-3)
  +
  if [[ -z "${PY_MAJOR_MINOR_VER}" ]]; then
  die "ERROR: Unable to determine the major.minor version of Python."
  fi
  echo "Python binary path to be used in PIP install: ${PYTHON_BIN_PATH} "\
  "(Major.Minor version: ${PY_MAJOR_MINOR_VER})"
  PYTHON_BIN_PATH_INIT=${PYTHON_BIN_PATH}
  -PIP_BIN_PATH="$(which pip${PYTHON_VER_CFG})"
  -PIP_BIN_PATH_INIT=${PIP_BIN_PATH}
  +PIP_BIN_PATH="$(which pip${PY_MAJOR_MINOR_VER})"
  # PIP packages
  INSTALL_EXTRA_PIP_PACKAGES=${TF_BUILD_INSTALL_EXTRA_PIP_PACKAGES}
  @@ -450,7 +447,7 @@ install_tensorflow_pip() {
  fi
  # Set path to pip.
  - PIP_BIN_PATH="$(which pip${PYTHON_VER_CFG})"
  + PIP_BIN_PATH="$(which pip${PY_MAJOR_MINOR_VER})"
  # Print python and pip bin paths
  echo "PYTHON_BIN_PATH to be used to install the .whl: ${PYTHON_BIN_PATH}"
  