在Ubuntu里安装特定版本的Python,常用方法有以下两种:
sudo add-apt-repository ppa:deadsnakes/ppa
。sudo apt update
。sudo apt install python3.8
。sudo apt install build-essential zlib1g-dev libncurses5-dev libssl-dev libreadline-dev libffi-dev wget
。wget https://mirrors.tuna.tsinghua.edu.cn/python/3.10.11/Python-3.10.11.tgz
。tar -zxvf Python-3.10.11.tgz
。cd Python-3.10.11
,./configure --prefix=/usr/local/python3.10.11 --enable-optimizations
。make -j(nproc)
,sudo make altinstall
。