小编给大家分享一下Ubuntu中如何升级python3.7.1,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!
下载源码
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
看完了这篇文章,相信你对“Ubuntu中如何升级python3.7.1”有了一定的了解,如果想了解更多相关知识,欢迎关注天达云行业资讯频道,感谢各位的阅读!