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

时间:2022-05-01 03:06:38

下载源码

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

配置安装路径

?
1
2
3
4
5
6
./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

删除软链接

?
1
2
sudo rm -rf /usr/bin/python3
sudo rm -rf /usr/bin/pip3

新建软链接

?
1
2
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

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

总结

以上所述是小编给大家介绍的Ubuntu下升级 python3.7.1流程备忘,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对服务器之家网站的支持!

原文链接:https://blog.csdn.net/jehon/article/details/84940548