To upgrade python in centOS, follow these steps:

Source: Internet
Author: User

To upgrade python in centOS, follow these steps:
1. You can use the built-in linux download tool wget to download, as shown below :(

 

The author installed the smallest centos system. Therefore, wget must be installed before using the compilation command. If you have installed the centos system on the interface or used a compilation tool, you can skip wget installation, directly to the following compilation steps) wget http://www.python.org/ftp/python/3.3.0/Python-3.3.0.tgz 2, after the download is complete to the download directory, decompress the tar-xzvf Python-3.3.0.tgz

 

3. Enter the decompressed folder cd Python-3.3.0

 

4. Create a folder python3 in/usr/local before compilation (as the python installation path to avoid overwriting the old version) mkdir/usr/local/python3 (mkdir is used to create a folder here, and touch is used to create a file)

 

5. Start compilation and installation (

 

The author installed the smallest centos system. Therefore, before using the compilation command, you must install the gcc compilation kit. If you have installed the centos system on the interface or used a compilation tool, you can skip the installation of gcc, directly perform the following compilation steps ). /configure -- prefix =/usr/local/python3

 

Make

 

Make install

 

6. At this time, the old version is not overwritten, and the original/usr/bin/python link is changed to another name (I keep two versions, one python and one python3, so the author skipped step 1 and changed the Link name after Step 3 to python3. The reader can follow the normal steps to achieve the same effect) mv/usr/bin/python/usr/bin/python_old2 7. Create a new version of python connection ln-s/usr/local/python3/bin/python3/usr/bin/python 8. Input python-V at this time.

 

10. The new version of python is displayed. [idolaoxu @ localhost home] # python-VPython 3.3.0 PS: if you do not create a new installation path, python3 is directly installed by default, then, the new python version after installation should be replaced by the old version that comes with linux, and may not be overwritten. For details, refer to the installation process. You can try it yourself, of course, if you want to retain the original version, this method is best.

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.