install python3.5 on Centos7

 

1.cheak the vision on centos7 system

# Python -V

2.install the depend pack which may be used for installing the python3.5

# yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel make wget

3.use the wget to download python3.5

# wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz

4.unzip the pack

# tar -zxvf Python-3.5.1.tgz

6.move the “python 3.5.1” to the /usr/local

# mv python-3.5.1 /usr/local

7.delete the old vision depend pack for python2

# ll /usr/bin | grep python

# rm -rf /usr/bin/python

8.open the folder and configure

# cd /usr/local/Python-3.5.1/

# ./configure

9.make and install

# make         notice:should wait for a very long time 

#make install

10.delete the old link for the python2 and create new link for the python3

# rm -rf /usr/bin/python

# ln -s /usr/local/bin/python3.5 /usr/bin/python

11.cheak the vision of the python

# python -V

12. cuz the yum depends on the python2,so the yum configure must be changed

# vi /usr/bin/yum

#! /usr/bin/python changed to #! /usr/bin/python2

# vi /usr/libexec/urlgrabber-ext-down 

#! /usr/bin/python changed to #! /usr/bin/python2

 

Copyright © 2018 by Liwen