源自:centos7编译安装Python3.6(与2.7并存)
环境准备:
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
安装:
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz tar -zxvf Python-3.6.5.tgz mv Python-3.6.5 /usr/local //删除旧依赖 ll /usr/bin | grep python rm -rf /usr/bin/python cd /usr/local/Python-3.6.5/ ./configure //配置 make //编译make make install //编译,安装 //删除旧的软链接,创建新的软链接到最新的python rm -rf /usr/bin/python ln -s /usr/local/bin/python3.6 /usr/bin/python //查看 python -V