Upgrade CentOS6 to Python2.7

Source: Internet
Author: User

Upgrade CentOS6 to Python2.7

Preparations before installation
This example uses CentOS6.7 as an example.
[Root @ E tools] # uname-r
2.6.32-431.23.3.el6.x86 _ 64
[Root @ E tools] # uname-m
X86_64
[Root @ E ~] # Python-V
Python 2.6.6

Kernel version 2.6.32 64-bit Operating System

Readline-devel is installed before installation. It cannot be used without "Create up, down, right, and down ".
Yum-y install readline-devel

Select the download Directory, which can be stored in the home directory.
[Root @ E ~] # Cd/home/evan/tools/

Download python2.7.11
Wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz

View download content
[Root @ E tools] # ls/home/evan/tools/
Python-2.7.11.tgz

Extract
Tar zxvf Python-2.7.11.tgz

Install python2.7.11
Cd Python-2.7.11
./Configure -- prefix =/application/python2.7.11
Make
Make install

Specify the installation path: -- prefix =/application/python2.7.11
Modify the default python version.
[Root @ E Python-2.7.11] # mv/usr/bin/python/usr/bin/python2.6.6
[Root @ E Python-2.7.11] # ln-s/application/python2.7.11/bin/python/usr/bin/python

Back up the original version and create a soft connection for version 2.7.11
View python version
[Root @ E Python-2.7.11] # python-V
Python 2.7.11

Applications such as yum may not be available after the python version is changed.
Modify the python version of yum
[Root @ E tools] # sed-I's @#! /Usr/bin/python @#! /Usr/bin/python2.6.6 @ G'/usr/bin/yum
[Root @ E tools] # grep python/usr/bin/yum
#! /Usr/bin/python2.6.6

You may also like the following article about Python:

Install Python3.5 on CentOS 7

Upgrade CentOS Python2.4 to Python2.7

Install Python3.5.0 on CentOS7 and the old version Python2.7.5 coexist.

Installation of Python in Linux and precautions

Install and use the Python rq module in Ubuntu 14.04

Install Python3.4 on CentOS source code

Python core programming version 2. (Wesley J. Chun). [Chinese version of hd pdf]

Python development technology details. (Zhou Wei, Zong Jie). [hd PDF scan version + book guide video + code]

Build a desktop algorithm transaction research environment using Python in Ubuntu

Python details: click here
Python: click here

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.