Linux centos7安装python3并且不影响python2

一、安装依赖 

  yum -y groupinstall "Development tools"
  yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel (3.7以上需要libffi-devel)
 
二、获取安装包 编译安装
  wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz
  tar -xvJf Python-3.6.4.tar.xz
  cd Python-3.6.4
  ./configure --prefix=/usr/local/python3
  make && make install
 
三、创建软连接
  ln -s /usr/local/python3/bin/python3 /usr/bin/python3
  ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
  
 
posted @ 2018-09-14 17:44  Presley  阅读(883)  评论(0编辑  收藏  举报