Python upgrade steps under Linux

Source: Internet
Author: User
Tags install openssl openssl

Install Openssl,openssl-devel First

yum install openssl
yum install openssl-devel

1 switch to the specified directory:

Cd/usr/local

2 Download the source tar package

Linux comes with the download tool wget download as follows:

1 # wget http://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz

  Extract

1 tar -xzvf Python-2.7.9.tgz

Build a folder in/usr/local before compiling Python3 (as a Python installation path to avoid overwriting the old version)

1 mkdir/usr/local/python2

  

Go to the Unpacked folder

1 CD Python-2.7.9

Start compiling the installation

1 ./configure --prefix=/usr/local/python2
2 make
3 makeinstall

The old version is not overwritten at this time, then the original/usr/bin/python link is changed to another name

1 mv/usr/bin/python /usr/bin/python_old

Link to build a new version of Python

1 ln-s /usr/local/python2/bin/python /usr/bin/python

This time input

1 python

The new version of Python will be displayed.


PS: If you do not set up a new installation path Python2, but the direct default installation, the installation of the new Python should be overwritten with the old version of Linux, or may not overwrite, the specific installation process, this can be tested by themselves, of course, if you want to keep the original version, So this is the best way to do it.

Python upgrade steps under Linux

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.