CentOS7.X上安装Python3.6.6
首先:
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
安装必要的组件
其次:https://www.python.org/downloads/
下载源码 from https://www.python.org/downloads/release/python-366/
XZ Compressed source tabball https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tar.xz
再则:解压
xz -d Python-3.6.6.tar.xz
tar -xvf Python-3.6.6.tar
然后:
./configure prefix=/usr/local/python3.6.6 --enable-optimizations# /usr/local/python3.6.6是安装的路径
make && make install
最后:
将/usr/local/python3.6.6 添加到 path中, /etc/profile
source /etc/profile