From 70b6f69440070ae11ba181dd3ba619640986f681 Mon Sep 17 00:00:00 2001 From: Alexey-Marushchenko <90276864+Alexey-Marushchenko@users.noreply.github.com> Date: Wed, 22 Sep 2021 22:05:50 +0300 Subject: [PATCH] Update init_python.sh 1. CentOS 8 pip upgrade solved. 2. Minor fixes. --- src/init/init_python.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/init/init_python.sh b/src/init/init_python.sh index 04709ba..66f802f 100755 --- a/src/init/init_python.sh +++ b/src/init/init_python.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Version 20210922_1904 if [ "$OS" == "Windows_NT" ] then @@ -9,7 +10,7 @@ then echo -en "Press ENTER when Setup is finished. " read -r RESPONSE else - PYTHON_BIN=python3 + PYTHON_BIN="python3" fi echo "${PYTHON_BIN}" @@ -21,14 +22,23 @@ else fi if [ -x "$(command -v pip3)" ]; then - PIP=pip3 + PIP="${PYTHON_BIN} -m pip" else exit 2 fi echo -en "Installing Python3 dependencies... " -$PIP install --upgrade pip --no-warn-script-location 2>&1 > /dev/null -$PIP install ipfshttpclient==0.8.0a2 web3 psutil --upgrade --no-warn-script-location 2>&1 > /dev/null + +if [ -f /etc/os-release ]; then +# CentOS 8 requires sudo for pip upgrade + if [ "$(grep -E "^NAME=" /etc/os-release | grep CentOS)" ]; then + sudo $PIP install --upgrade pip -qq > /dev/null 2>&1 + fi +else + $PIP install --upgrade pip -qq > /dev/null 2>&1 +fi + +$PIP install ipfshttpclient==0.8.0a2 web3 psutil --upgrade -qq > /dev/null 2>&1 echo "done" [ -d certs ] || mkdir certs