Linux installation python2.7

Source: Internet
Author: User

Linux comes with Python is version 2.6, used to 2.7.x, so want to upgrade Python2

1. Download the source package, the following download link directly on the Python official website, if you want to install a higher version of the self-replacement

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

2. Unzip the package

Tar xvf python-2.7.10.tgz

3. Specify the installation path

CD Python-2.7.10. /configure--prefix=/usr/local/python2

4. Compiling and installing

Makemake Install

5. Create a link to point Python to version 2.7

Python defaults to the 2.6 version of the

Delete the original link to 2.6, create a new link to 2.7, and execute Python to see that it's already pointing to the 2.7 version.

Rm-f/usr/bin/-s/usr/local/python2/bin/python/usr/bin/python

6. Install Pip, also go to the Python website to find the download link, need Setup-tools and PIP two package

wget https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/ pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9wget https://pypi.python.org/ Packages/84/08/c01703c62d4eda7ae0c38deeb8adb864d0c90367a4c3e4299b917ac88a39/setup-tools-36.0.1.zip# md5=57fed189bd50ffc95bbc3ca38670834b

Unpack the Tarball

Tar xvf pip-9.0.1. Tar.gzunzip Setup

"If you do not have unzip, use the Yum install Unzip installation first, Yum is not able to use the"

8. Using Python for installation

Install Setup-tools First

CD setup-tools-36.0.1python setup.py install

Execute the Python bootstrap.py before executing the python setup.py install if the execution fails

Install PIP after successful installation, go to pip directory, execute python setup.py install pip

CD pip-9.0.1python setup.py install

Soft link to create pip after successful installation

Ln-s/usr/local/python2/bin/pip/usr/bin/pip
Pip

Can be happy to use the PIP ~ ~ ~

Linux installation python2.7

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.