Ubuntu16.04更新python3.5到python3.7

时间:2022-11-12 06:28:28

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

解压
tar zxvf Python-3.7.1rc2.tgz
cd Python-3.7.1rc2

编译
./configure
make
make install

先找的python3.7解释器位置,一般是
/usr/local/bin/python3.7

删除原来的软连接
rm -rf /usr/bin/python3
rm -rf /usr/bin/pip3

#添加python3的软链接
ln -s /usr/local/bin/python3.7 /usr/bin/python3
#添加 pip3 的软链接
ln -s /usr/local/bin/pip3.7 /usr/bin/pip3