当前位置:主页 > 软件编程 > Python代码 >

Ubuntu下升级 python3.7.1流程备忘(推荐)

时间:2020-12-19 10:20:12 | 栏目:Python代码 | 点击:

下载源码

wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz

解压源码

tar -xvzf Python-3.7.1.tgz

进入目录

cd Python-3.7.1

配置安装路径

./configure --with-ssl --prefix=/usr/local/python3
安装python3.7.1依赖
#sudo apt-get update
#sudo apt-get upgrade
#sudo apt-get dist-upgrade
sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus libncursesw5-dev libgdbm-dev libc6-dev zlib1g-dev libsqlite3-dev tk-dev libssl-dev openssl libffi-dev

编译

make

安装

sudo make install

删除软链接

sudo rm -rf /usr/bin/python3
sudo rm -rf /usr/bin/pip3

新建软链接

sudo ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
sudo ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3

检查是否安装成功

python3

总结

您可能感兴趣的文章:

相关文章