1: 从源码安装Python 3.6
官方正式版为Python 3.6.3
cd /opt
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
tar -xvf Python-3.6.3.tgz
cd Python-3.6.3
./configure
make
make install
如果有以下错误信息,安装zlib1g-dev
zipimport.ZipImportError: can't decompress data; zlib not available
apt-get install zlib1g-dev
# python3.6 -V
Python 3.6.3
2: 从PPA安装 Python 3.6
添加PPA源
# apt-get install software-properties-common python-software-properties
# add-apt-repository ppa:jonathonf/python-3.6
Press [ENTER] to continue or ctrl-c to cancel adding it
安装Python 3.6
# apt-get update
# apt-get install python3.6
# python3.6 -V
Python 3.6.3
To learn more about Python version 3.6 check their official release notes.
网友评论