1.安装依赖包
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev
sudo apt-get install -y libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm
sudo apt-get install -y libncurses5-dev libncursesw5-dev xz-utils tk-dev
2.下载python
sudo wget https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz
3.解压
sudo tar -zxvf Python-3.8.5.tgz
4.进入目录
cd Python-3.8.5
5.安装python
sudo ./configure --prefix=/usr/local/python3 && make && make install
6.创建软连接
sudo ln -s /usr/local/python3/bin/python3 /usr/local/bin/python3
sudo ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip3
7.查看版本
python3 -V
pip3 -V
网友评论