0. 安装pip3,并升级,以及依赖包
更新
sudo apt update
安装pip3,并更新
sudo apt install python3-pip
pip3 install --upgrade pip
安装 wget
sudo apt-get update
sudo apt-get install wget
安装 lrzsz
sudo apt-get install lrzsz
安装 gcc
sudo apt-get build-dep gcc 或 sudo apt-get install build-essential
安装 make
sudo apt-get install ubuntu-make
安装 openssl
sudo apt-get install openssl libssl-dev
安装 pcre-devel
sudo apt-get install libpcre3 libpcre3-dev
安装 zlib
sudo apt-get install zlib1g-dev
sudo apt-get install libffi-devel
1. 进入准备存放源代码的目录:
cd /usr/local/src
2. 下载源代码:
3.解压缩:
tar –zxvf Python-3.8.1.tgz
4.进入解压缩后的源代码目录:
cd Python-3.8.1
5.配置:指定安装目录(/usr/local/Python-3.8.1)
./configure --prefix=/usr/local/Python-3.8.1 --enable-optimizations
6.编译、安装:
make && make install
7.创建软连接
ln -s /usr/local/Python-3.8.1/bin/python3 /usr/bin/python3
ln -s /usr/local/Python-3.8.1/bin/pip3 /usr/bin/pip3