CentOS version is 7 to upgrade python 3.X

As the official has announced python 2.x series will stop support, in order to look ahead, we upgrade the system python version 3.x series of
server systems for the most current CentOS 7.4

 

1. Before installing python to view the version number of the current system

# Python -V

2. Get the official package python3.x

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

3. Unzip the package

# tar -zxvf Python-3.6.5.tgz

4. Installation Configuration at extract directory

# cd Python-3.6.5
# ./configure

5. Compile and install

# make
# make install

6. Verify that the installation of the current system python version
# python3 -V

7. python3 a look at the newly installed file location

8. back up the original configuration, set the default python version is 3.x

# mv /usr/bin/python /usr/bin/python.bak
# ln -s /usr/local/bin/python3 /usr/bin/python

9. look 2.x version of the file location

10. In order to yum command, it is required to configure the python still directed version 2.x

/ usr / bin / yum
/ usr / libexec / urlgrabber-EXT-Down
to modify the header file for the above two files, the old version to
/ usr / bin / python -! !> /usr/bin/python2.7

Guess you like

Origin www.cnblogs.com/goddog1024/p/11221325.html