centos 7 python2.7.5升级到3.5.2
下载python3.5.2
wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
安装
- 解压:tar -zxvf Python-3.5.2.tgz
- 进入解压目录: cd Python-3.5.2
- 创建安装目录: mkdir /usr/local/python3.5.2
- 编译: ./configure –prefix=/usr/local/python3.5.2
- 安装: make && make install
- 备份原有python:mv /usr/bin/python /usr/bin/python_2.7.5
- 创建软连接:ln -s /usr/local/python3.5.2/bin/python3.5 /usr/bin/python
查看版本
python --version
输出
Python 3.5.2
至此,python升级成功。
—恢复内容结束—
# ** centos 7 python2.7.5升级到3.5.2 **
下载python3.5.2
wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
安装
- 解压:tar -zxvf Python-3.5.2.tgz
- 进入解压目录: cd Python-3.5.2
- 创建安装目录: mkdir /usr/local/python3.5.2
- 编译: ./configure –prefix=/usr/local/python3.5.2
- 安装: make && make install
- 备份原有python:mv /usr/bin/python /usr/bin/python_2.7.5
- 创建软连接:ln -s /usr/local/python3.5.2/bin/python3.5 /usr/bin/python
查看版本
python --version
输出
Python 3.5.2
至此,python升级成功。