diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 10dc84122..ff15c4306 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2739,23 +2739,23 @@ __install_salt_from_repo() { echodebug "__install_salt_from_repo py_exe=$_py_exe" _py_version=$(${_py_exe} -c "import sys; print('{0}.{1}'.format(*sys.version_info))") - _pip_cmd="pip${_py_version}" - if ! __check_command_exists "${_pip_cmd}"; then - echodebug "The pip binary '${_pip_cmd}' was not found in PATH" - _pip_cmd="pip$(echo "${_py_version}" | cut -c -1)" + _pip_cmd="${_py_exe} -m pip" + if ${_pip_cmd} --version > /dev/null 2>&1; then + _pip_version="$(${_pip_cmd} --version 2>/dev/null)" + else + echodebug "Pip is not installed for Python '${_py_exe}' (version ${_py_version})" + _pip_cmd="pip${_py_version}" if ! __check_command_exists "${_pip_cmd}"; then echodebug "The pip binary '${_pip_cmd}' was not found in PATH" - _pip_cmd="pip" - if ! __check_command_exists "${_pip_cmd}"; then - echoerror "Unable to find a pip binary" - return 1 - fi + echoerror "Unable to find a pip binary" + return 1 fi + _pip_version="$(${_pip_cmd} --version 2>/dev/null)" fi __check_pip_allowed - echodebug "Installed pip version: $(${_pip_cmd} --version)" + echodebug "Installed pip version: $_pip_version" _setuptools_dep="setuptools>=${_MINIMUM_SETUPTOOLS_VERSION},<${_MAXIMUM_SETUPTOOLS_VERSION}" if [ "$_PY_MAJOR_VERSION" -ne 3 ]; then