安装需要的程序包
$ sudo apt-get install build-essential checkinstall
$ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
解压下载的python3.5.2的安装包
因为Python3.5.2的安装包是tar.xz结尾
**tar xvJf ***.tar.xz来解压**
编译源代码
$ cd Python-3.5.2
$ sudo ./configure
$ sudo make altinstall
设置默认版本
此时python3.5.2已经安装完毕,但是如果只在终端输入python,默认python2.7,删除原来的链接到2.7的文件
sudo rm /usr/bin/python
sudo ln /usr/bin/python3.5 /usr/bin/python
网友评论