1. 安装Python3.6前须知:
Ubuntu默认安装了Python2.7(python已安装pip,可直接使用)和3.5(未安装pip,若要使用须自行安装pip),系统自带的python千万不能卸载;
自带Python2.7(命令:python查看)和3.5(命令:python3查看);
Python2.7 pip查看:pip -v 或者 pip --version;
2. 安装Python3.6:
添加PPA:
sudo add-apt-repository ppa:deadsnakes/ppa
注意:使用旧版本的ppa:sudo add-apt-repository ppa:jonathonf/python-3.6;报错:E: Unable to locate package python3.6 E: Couldn't find any package by glob 'python3.6'
更新软件列表:
sudo apt-get update
最后,安装python3.6
sudo apt-get install python3.6
调整Python3的优先级,使得3.6优先级较高;
sudo update-alternatives -