添加第三方库,安装Python 3.12
apt install software-properties-common -y
add-apt-repository ppa:deadsnakes/ppa
apt update
apt install python3.12
安装pip3
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12
设置系统默认的Python版本,如果只安装了一个版本可忽略
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
sudo update-alternatives --config python3
