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