centos7 安装python

  yum groupinstall 'Development Tools'
  yum install zlib-devel bzip2-devel  openssl-devel ncurses-devel
  wget  https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tar.xz
  ls
  tar Jxvf  Python-3.5.0.tar.xz
  cd Python-3.5.0
  ./configure --prefix=/usr/local/python3
  make && make install
  ln -s /usr/local/python3/bin/python3.5 /usr/local/bin/python3
  python
[root@localhost Python-3.5.0]# python
Python 2.7.5 (default, Nov  6 2016, 00:28:07) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

安装成功

原文地址:https://www.cnblogs.com/fuyuanming/p/6519810.html