From 621934533e5283057f15d573e765aa8727d2ca19 Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Tue, 30 Aug 2022 11:14:13 +1000 Subject: [PATCH] Fix: Update python tools install - Set the default version of python3 instead of 3.8.x since some of the older images may not have this version installed. The default version is only used when lf-env.sh is not available. - CR I821a86ac3b54f2 sets and uses python 3.x version made available by pyenv therefore remove the --user option which is no longer required. Issue-ID: RELENG-4357 Change-Id: Ic01b696354434291b49c5f8a125fd6593ca37c96 Signed-off-by: Anil Belur --- .../notes/fix-python-tools-install-5ee151d38e9eb2dd.yaml | 14 ++++++++++++++ shell/python-tools-install.sh | 10 +++++----- 2 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/fix-python-tools-install-5ee151d38e9eb2dd.yaml diff --git a/releasenotes/notes/fix-python-tools-install-5ee151d38e9eb2dd.yaml b/releasenotes/notes/fix-python-tools-install-5ee151d38e9eb2dd.yaml new file mode 100644 index 00000000..3eac10a9 --- /dev/null +++ b/releasenotes/notes/fix-python-tools-install-5ee151d38e9eb2dd.yaml @@ -0,0 +1,14 @@ +--- +issues: + - | + ERROR: Not installed on host: python3.8.13 + ERROR: Can not perform a '--user' install. User site-packages are not + visible in this virtualenv. +fixes: + - | + Set the default version to 'python3' instead of '3.8.x' since some of the + older images may not have the specifc version installed. The default + version is only used when lf-env.sh is not available. + + CR I821a86ac3b54f2 sets and uses python 3.x version made available by pyenv + therefore remove the --user option which is no longer required. diff --git a/shell/python-tools-install.sh b/shell/python-tools-install.sh index 8251487d..c8173609 100644 --- a/shell/python-tools-install.sh +++ b/shell/python-tools-install.sh @@ -13,7 +13,7 @@ echo "---> python-tools-install.sh" set -eufo pipefail # Souce the python version from lf-env.sh if available. -python="python3.8.13" +python="python3" if [[ -f ~/lf-env.sh ]]; then source ~/lf-env.sh lf-activate-venv --python "$python" lftools @@ -68,10 +68,10 @@ EOF fi fi - python3 -m pip install --user --quiet --upgrade pip - python3 -m pip install --user --quiet --no-warn-script-location --upgrade setuptools - python3 -m pip install --user --quiet --no-warn-script-location --upgrade lftools[openstack] - python3 -m pip install --user --quiet --no-warn-script-location --upgrade \ + python3 -m pip install --quiet --upgrade pip + python3 -m pip install --quiet --no-warn-script-location --upgrade setuptools + python3 -m pip install --quiet --no-warn-script-location --upgrade lftools[openstack] + python3 -m pip install --quiet --no-warn-script-location --upgrade \ --upgrade-strategy eager -r "$requirements_file" # installs are silent, show version details in log python3 --version -- 2.16.6