Install the Python 2.7 (Linux) __linux in a compiled fashion

Source: Internet
Author: User
Tags openssl readline

My machine's default Python version is 2.6.6, and now I want to install a 2.7 version.

Download address of package: https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz

Ensure that it is installed first: zlib zlib-devel OpenSSL openssl-devel readline readline-devel

First, the specific installation:

Tar zxf python-2.7.10.tgz

CD Python-2.7.10

./configure--prefix=/usr/local/python

Make && make install

Second, start python2.7:

[Root@pc ~]#/usr/local/python/bin/python2.7

Third: Establish soft connection

Ln-s/usr/local/python/bin/python2.7/bin/python2.7

[Root@pc download]# python2.7
Python 2.7.10 (Default, Dec 31 2015, 02:13:11)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2
Type ' help ', ' copyright ', ' credits ' or ' license ' for the more information.

Four: Set python2.7 as the default version

[Root@pc bin]# mv/usr/bin/python/usr/bin/python2.6.6
[Root@pc bin]# ln-s/usr/local/python/bin/python2.7/usr/bin/python

[Root@pc bin]# python
Python 2.7.10 (Default, Dec 31 2015, 02:13:11)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2
Type ' help ', ' copyright ', ' credits ' or ' license ' for the more information.
>>>

--This article from: http://www.linuxidc.com/Linux/2015-08/120895.htm,

Http://www.linuxeye.com/Linux/1762.html,

Http://blog.sina.com.cn/s/blog_69309a3c0100wit5.html



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.