diff --git a/scripts/env-setup.sh b/scripts/env-setup.sh index aa1d76fda..030295149 100755 --- a/scripts/env-setup.sh +++ b/scripts/env-setup.sh @@ -11,7 +11,7 @@ ANSIBLE_PIP_VERSION=${ANSIBLE_PIP_VERSION:-${DEFAULT_PIP_ANSIBLE}} ANSIBLE_SOURCE_PATH=${ANSIBLE_SOURCE_PATH:-ansible${ANSIBLE_PIP_VERSION}} if [ -n "${VENV-}" ]; then - sudo -H -E ${PIP} install "${ANSIBLE_SOURCE_PATH}" + ${PIP} install "${ANSIBLE_SOURCE_PATH}" ANSIBLE=${VENV}/bin/ansible else ${PIP} install --user --upgrade "${ANSIBLE_SOURCE_PATH}" diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index d5fd75e7e..ffcd874cc 100644 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -98,6 +98,7 @@ if [ -n "${VENV-}" ]; then if [ ! -f ${VENV}/bin/activate ]; then # only create venv if one doesn't exist sudo -H -E python3 -m venv --system-site-packages ${VENV} + sudo -H -E chown -R ${USER} ${VENV} fi # Note(cinerama): activate is not compatible with "set -u"; # disable it just for this line. @@ -111,9 +112,9 @@ fi # If we're using a venv, we need to work around sudo not # keeping the path even with -E. -PYTHON=$(which python3) +PYTHON="python3" +PIP="${PYTHON} -m pip" -ls $PYTHON $PYTHON << EOF import pip version = tuple(map(int, pip.__version__.split('.'))) @@ -126,8 +127,6 @@ if [ -n "${VENV-}" ]; then ls -la ${VENV}/bin fi -PIP=$(echo $PYTHON | sed 's/python/pip/') - # Install the rest of required packages using bindep sudo -H -E ${PIP} install bindep