CentOS7升级Python-2.7.15

  sre

从2.7.5升级到2.7.15
wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz
tar zxvf Python-2.7.15.tgz
cd Python-2.7.15
./configure –prefix=/usr/local
make -j 8 ; make install

mv /usr/bin/python /usr/bin/python2.7.15

vim /etc/profile
export PATH=”/usr/local/bin:$PATH”

vim /usr/bin/yum
vim /usr/libexec/urlgrabber-ext-down
#!/usr/bin/python改为 #!/usr/bin/python2.7.5

#pip安装
cd
wget https://files.pythonhosted.org/packages/45/ae/8a0ad77defb7cc903f09e551d88b443304a9bd6e6f124e75c0fbbf6de8f7/pip-18.1.tar.gz
tar zxvf pip-18.1.tar.gz
cd pip-18.1
wget https://files.pythonhosted.org/packages/26/e5/9897eee1100b166a61f91b68528cb692e8887300d9cbdaa1a349f6304b79/setuptools-40.5.0.zip
unzip setuptools-40.5.0.zip
cd setuptools-40.5.0
python setup.py install
cd ../
python setup.py install

LEAVE A COMMENT

Captcha Code