Ubuntu下安装升级Python3.5

1.首先去https://www.python.org/downloads/release/python-351/下载Python3.5

2.解压:

$ tar -xvf Python-3.5.1.tgz

3.进入解压后的目录:

$ cd Python-3.5.1

4.创建安装目录:

$ sudo mkdir /usr/local/python3.5

5.编译安装,具体可以看README

$ ./configure --prefix=/usr/local/python3.5/
$ sudo make && make install

6.修改Python3.5为默认版本

$ sudo mv /usr/bin/python /usr/bin/python_bak
$ sudo ln -s /usr/local/python3.5/bin/python3.5 /usr/bin/python

至此,我们已经安装完成,检查一下版本:

$ python -V
Python 3.5.1

done.

评论 (2)
  1. 沙发
    Lann 2016-04-08 04:33

    小学生你好