1 准备工作
步骤1:更换镜像
# 位置:/etc/apt/sources.listdeb http://deb.debian.org/debian/ stretch main contrib non-free
deb http://deb.debian.org/debian/ stretch-updates main contrib non-free
deb http://security.debian.org/debian-security stretch/updates main contrib non-free
步骤2:安装扩展
sudo apt update
sudo apt upgrade
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget2 下载源码
wget https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz3 解压源码包
tar -xf Python-3.7.9.tgz
cd Python-3.7.94 配置和编译
./configure --enable-optimizations
make -j 45 安装 Python
sudo make altinstall6 验证安装
python3.7 --version7 设置 Python 3.7 为默认版本(可选)
sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3.7 1
sudo update-alternatives --config python 智享笔记
								    智享笔记								 
                             
                             
                             
                            