Centos7.3下安装Python3.6.3和下载py库的pip命令
安装Python3.6.3
更新安装必要库yum update
yum -y install gcc gcc-c++ make zlib* openssl openssl-devel openssl-static -y
1. 查看本机的Python版本python -V
2. 下载Python3.6.3的包 ->解压 ->编译 ->安装cd /root
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
tar -zxvf Python-3.6.3.tgz
mkdir /usr/local/python3
cd Python-3.6.3
./configure --prefix=/usr/local/python3
make
make install
3. 备份旧版本Python,链接新版本Pythoncd /usr/bin
mv python python.bak
ln -s /usr/local/python3/bin/python3 /usr/bin/python
4. 修改yum配置文件vi /usr/bin/yum
vi /usr/libexec/urlgrabber-ext-down
把第一行的python改成旧版的python2.7(第一次python -V查出来的)
测试下yum是否正常
OK,安装成功~
安装pip命令
1. 安装python-setuptoolsyum install python-setuptools -y
# 或者 yum install python3-setuptools -y
easy_install pip
# 或者 easy_install3 pip