1,centos7默认是装有python的,检查python版本的命令
# 检查python版本 : python -V
2,centOS在安装python3以及tab补全功能
下载python3源码,选择3.6.7因为ipython环境
wget https://www.python.org/ftp/python/3.6.7/Python-3.6.7.tar.xz
解压缩源码包.去除xz后缀
xz -d Python-3.6.7.tar.xz
解压缩源代码,去掉tar后缀
tar -xf Python-3.6.7.tar
解决编译安装python3所需的软件依赖(解决这些依赖关系后期才能正常运转python3.6,如果不解决,会出现各种报错信息,此时还得重新编译python3.6)
yum install gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel -y