Centos7.3下安装Python3.6.3和下载py库的pip命令
更新安装必要库
yum update
yum -y install gcc gcc-c++ make zlib* openssl openssl-devel openssl-static -y
python -V
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
Python官方的ftp库:https://www.python.org/ftp/python/
cd /usr/bin
mv python python.bak
ln -s /usr/local/python3/bin/python3 /usr/bin/python
vi /usr/bin/yum
vi /usr/libexec/urlgrabber-ext-down
把第一行的python改成旧版的python2.7(第一次python -V
查出来的)
测试下yum是否正常
OK,安装成功~
yum install python-setuptools -y
# 或者 yum install python3-setuptools -y
easy_install pip
# 或者 easy_install3 pip