centos7.3 Change Python version---2.7.5 to 3.6.4

Source: Internet
Author: User

1. Preparation
    • System version

      cat /etc/redhat-release

    • Install dependent packages
      yum -y install wget sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release
2. Download the decompression installation python3.6.4
wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgztar zxvf Python-3.6.4.tgzcd Python-3.6.4./configuremake && make install
    • Rename the original Python

      mv /usr/bin/python /usr/bin/python.bak
    • Creating a soft connection

      ln -s /usr/local/bin/python3 /usr/bin/python
    • View Python version, has become 3.6.4
3. Yum is not available after updating Python version


You need to modify usr/libexec/urlgrabber-ext-down and /usr/bin/yum two files at this time

Modify the first line parameter in these two files, change #!/usr/bin/python to #!/usr/bin/python2.7 and save exit.

    • Yum resumes normal use after completion

centos7.3 Change Python version---2.7.5 to 3.6.4

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.