在Ubuntu16.04上安装Python时安装不了:
执行以下命令即可安装:
#添加ppa到系统
sudo add-apt-repository ppa:jonathonf/python-3.6
此时系统会提示:
A plain backport of *just* Python 3.6. System extensions/Python libraries may or may not work.
Don't remove Python 3.5 from your system - it will break.
More info: https://launchpad.net/~jonathonf/+archive/ubuntu/python-3.6
Press [ENTER] to continue or ctrl-c to cancel adding it
按Enter即可,然后执行如下命令:
sudo apt-get update
再次安装就可以了:
sudo apt-get install python3.6
如果提示如下:
E: Failed to fetch http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu/pool/main/p/python3.6/python3.6-minimal_3.6.3-1ubuntu1~16.04.york1_amd64.deb Connection timed out
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
再执行一遍apt-get install
就好了。