How to update Python to the latest version in CentOS

Source: Internet
Author: User
1. Download Python's latest installation package

Download with linux wget download (current latest version python2.7.10), under downloads below individual users

CD ~/downloads/

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

Then start downloading the following image:

Wait for download complete

Create a folder for the installation directory before compiling
mkdir/usr/local/python2.7.10

Extract:
TAR-ZXVF python-2.7.10.tgz
into the uncompressed folder
CD Python-2.7.10

Compiling in the uncompressed directory
./configure–prefix=/usr/local/python2.7.10
There are errors like the following, because I don't have GCC installed, so I need to install GCC or gcc-c++

2. Install the compilation environment GCC, there are many ways to install it * *

The first type: yum groupinstall "Development Tools"
The second type: yum install gcc gcc-c++ kernel-devel
The third type:
Yum Install GCC
Yum Install gcc-c++
Yum Install make
Everyone according to the needs of the choice, first and three ways I personally verify the feasibility of installation, after the compilation
./configure–prefix=/usr/local/python2.7.10
This can be compiled normally, without the above error.
Then
Make

Installation

Make Install 3. After the installation completes, needs to establish the soft connection and other processing

3.1 Renaming the old version
Mv/usr/bin/python/usr/bin/python_old

3.2 Create a new version of the link
Ln-s/usr/local/python2.7.10/bin/python2.7/usr/bin/python

3.3 Check the latest Python version
Python-v

Display the latest version information so you can start the latest version of the Python tour.

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.