阿里云ecs centos7.4 不卸载python2的情况下安装python3 及踩过的的坑
进入centos,打开终端 输入 sudo yum -y groupinstall “Development tools” 输入 sudo 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 libffi-devel 输入 wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0a1.tar.xz 拷贝到自己的文件夹下,解压,或者 输入tar -xvJf Python-3.7.0a1.tar.xz 进入到解压好的文件夹 重新打开终端,或者cd Python-3.7.0a1 ./configure --prefix=/usr/local/bin/python3.7 指定目录 make &&make install 顺利的话最后提示pip安装成功 ln -s /usr/local/bin/python3.7/bin/python3 /usr/bin/python3 ln -s /usr/local/bin/python3.7/bin/pip3 /usr/bin/pip3 输入python3