Upgrade Python version under CentOS, detailed steps

Source: Internet
Author: User

1, you can use the Linux self-contained download tool wget download, as follows: (

The author installs the minimum CentOS system, so the wget service must be installed before using the Compile command, if the reader installs the interface CentOS system, or if the compiler tool is used, the installation wget can be skipped, and the following compilation steps will be done directly)wget http://www.python.org/ftp/python/3.3.0/Python-3.3.0.tgz 2, download the completion of the download directory, unzipTAR-XZVF python-3.3.0.tgz

3. Enter the extracted folderCD Python-3.3.0

4, build a folder in/usr/local before compiling Python3 (as a Python installation path, so as not to overwrite the old version)Mkdir/usr/local/python3(Create a new folder here with mkdir, and touch if you are creating a new file)

5. Start compiling the installation (

The author installs the minimum CentOS system, so before using the compile command, you must install the compilation Suite gcc, if the reader installs the interface CentOS system, or the use of the compiler tool can skip the installation of GCC, directly below the compilation steps)./configure--prefix=/usr/local/python3

Make

Make Install

6, at this time does not overwrite the old version, and then the original/usr/bin/python link changed to another name (the author retains two versions of, a python, a python3, so the 6th step of the author skipped, the 7th step of the link after the name changed to Python3, the reader can follow the normal steps, Achieve the same effect)mv/usr/bin/python/usr/bin/python_old27. Create a new version of the Python linkln-s/usr/local/python3/bin/python3/usr/bin/python8. Enter at this timepython-v

10. A new version of Python will be displayed. [email protected] home]# python-vPython 3.3.0 PS: If you do not set up a new installation path Python3, but rather a direct default installation, the new Python after installation should be overwritten with the old Linux version, or may not overwrite, the specific look at the installation process, this everyone can test their own, Of course, if you still want to keep the original version, then this method is best.

Upgrade Python version under CentOS, detailed steps

Related Article

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.