From a8d59b244026b8eaddca56d794ceba97dbac4262 Mon Sep 17 00:00:00 2001 From: Shamil Mubarakshin <127750046+shamil-mubarakshin@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:57:53 +0100 Subject: [PATCH] [Ubuntu24] Update pipx installation method (#10872) --- images/ubuntu/scripts/build/install-python.sh | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/images/ubuntu/scripts/build/install-python.sh b/images/ubuntu/scripts/build/install-python.sh index d88945e3..83ae5187 100644 --- a/images/ubuntu/scripts/build/install-python.sh +++ b/images/ubuntu/scripts/build/install-python.sh @@ -12,24 +12,22 @@ source $HELPER_SCRIPTS/os.sh # Install Python, Python 3, pip, pip3 apt-get install --no-install-recommends python3 python3-dev python3-pip python3-venv -# Install pipx -# Set pipx custom directory -export PIPX_BIN_DIR=/opt/pipx_bin -export PIPX_HOME=/opt/pipx if is_ubuntu24; then - apt-get install --no-install-recommends pipx - pipx ensurepath - # Create temporary workaround to allow user to continue using pip sudo cat < /etc/pip.conf [global] break-system-packages = true EOF - -else - python3 -m pip install pipx - python3 -m pipx ensurepath fi + +# Install pipx +# Set pipx custom directory +export PIPX_BIN_DIR=/opt/pipx_bin +export PIPX_HOME=/opt/pipx + +python3 -m pip install pipx +python3 -m pipx ensurepath + # Update /etc/environment set_etc_environment_variable "PIPX_BIN_DIR" $PIPX_BIN_DIR set_etc_environment_variable "PIPX_HOME" $PIPX_HOME