1、下载安装包
wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0b4.tgz
2、创建安装路径
mkdir /usr/local/python3
3、解压
tar -zvxf Python-3.5.0b4.tgz
4、安装
进入解压目录
./configure --prefix=/usr/local/python3
make
make install
5、更改环境变量
先把旧版本改名
which python
(/usr/bin/python)
mv /usr/bin/python /usr/bin/python2
创建链接
ln /usr/local/python3/bin/python3.5 /usr/bin/python
时间: 2024-10-28 15:31:33