Linux upgrade Python version to 3

Source: Internet
Author: User

Reference URL:

http://blog.csdn.net/liang19890820/article/details/51079633

Thank you ~

Linux:centos 7.2.1511

python:2.7

Operation:

①wget https://www.python.org/ftp/python/3.5.5/Python-3.5.5.tar.xz Download

②tar XVJF PYTHON-3.5.5.TAR.XZ Decompression

③CD Python-3.5.5 Switch Directory

④./configure compiling

⑤make && make install-----> If no error message is provided, this step installs the Python3. X.

Ls-al/usr/bin | grep python----> Execute this command to see why you can enter Python to call version 2.7 on the command line

Then handle the soft link

⑥MV/USR/BIN/PYTHON/USR/BIN/PYTHON.BEF Rename the Python file under/usr/bin to PYTHON.BEF, rename the name to be free

⑦ln-s/usr/local/bin/python3/usr/bin/python Create soft links for Python3

At this point, Python is entered in the command line, and the python3.x version is called.

Below is the configuration yum (well, I do not know why to configure this, Yum is installed, and what does Python have to do with it?). When I get it, I'll add it.

⑧/usr/bin/yum and/usr/libexec/urlgrabber-ext-down Modify the first line of code in two files

#!/usr/bin/python Change to #!/usr/bin/python2.7

Above, we have completed the update of Python version to 3.X on the linux_centos7.2 system.

Thank you for the reference URL in the explanation, clearly operable, I explained the perfect upgrade, handy summary, and did not encounter the error message in the article. Thanksgiving!

Linux upgrade Python version to 3

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.