系统环境centos 6.5
原python版本2.6.6
目标python版本3.5.1
1.下载python3.5
wget --no-check-certificate
2.解压文件 编译 安装
tar -xvzf Python-3.3.0.tgz
cd Python-3.3.0
./configure --prefix=/home/python/soft_install/python3.3/
make
make install
进入 安装目录下的bin目录,检查是否安装成功
./python3.3 -V ---如果安装成功则会显示安装的版本号
修改默认的python ,重新建立软链接
ln -s /home/python/soft_install/python3.3/bin/python3.3 /usr/bin/python
The above is the detailed content of python2 upgraded to python3. For more information, please follow other related articles on the PHP Chinese website!