From f943f97cdd137e997974d610b2bbc8055868e63b Mon Sep 17 00:00:00 2001 From: BitMaster Admin Date: Thu, 3 Oct 2024 08:46:30 +0300 Subject: [PATCH] Update install_latest_python.sh --- install_latest_python.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/install_latest_python.sh b/install_latest_python.sh index 26e29c3..434006b 100644 --- a/install_latest_python.sh +++ b/install_latest_python.sh @@ -30,7 +30,7 @@ echo "Updating package list after adding PPA..." sudo apt update check_error "Failed to update package list after adding PPA." -# Step 5: Install the latest Python version (e.g., Python 3.11) +# Step 5: Install the latest Python version (e.g., Python 3.12) PYTHON_VERSION=3.12 echo "Installing Python $PYTHON_VERSION..." sudo apt install -y python${PYTHON_VERSION} @@ -46,16 +46,12 @@ echo "Installing pip for Python $PYTHON_VERSION..." sudo apt install -y python3-pip check_error "Failed to install pip." -# If pip is not installed for the latest version, use get-pip.py -if ! command -v pip3 &> /dev/null; then - echo "Pip not found, downloading get-pip.py..." - curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py - sudo python${PYTHON_VERSION} get-pip.py - check_error "Failed to install pip using get-pip.py." - rm get-pip.py -fi +# Step 8: Install distutils for Python $PYTHON_VERSION (required for pip) +echo "Installing distutils for Python $PYTHON_VERSION..." +sudo apt install -y python${PYTHON_VERSION}-distutils +check_error "Failed to install distutils." -# Step 8: Verify installation +# Step 9: Verify installation echo "Verifying Python and pip installation..." python3 --version pip3 --version