首先:css
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make python
安裝必要的組件sql
其次:https://www.python.org/downloads/spa
下載源碼 from https://www.python.org/downloads/release/python-366/code
XZ Compressed source tabball https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tar.xzsqlite
再則:解壓ip
xz -d Python-3.6.6.tar.xz
tar -xvf Python-3.6.6.tar
而後:ssl
./configure prefix=/usr/local/python3.6.6 --enable-optimizations# /usr/local/python3.6.6是安裝的路徑
源碼
make && make installopenssl
最後:
將/usr/local/python3.6.6 添加到 path中, /etc/profile
source /etc/profile