[Ubuntu24] Update pipx installation method (#10872)

This commit is contained in:
Shamil Mubarakshin
2024-10-30 14:57:53 +01:00
committed by GitHub
parent a531b96b21
commit a8d59b2440

View File

@@ -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 <<EOF > /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