Linux re-install Python

Source: Internet
Author: User

First step: Download python2.7 wget https://www.Python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz

Step two: Unpack the compressed package that you just downloaded #tar-xvf python-2.7.12.tar.xz

Step three: Create a new installation directory Mkdir/usr/local/python27

Fourth step: Compile./configure--prefix=/usr/local/python27 #将安装路径指向刚创建的python路径

The configure:error:no acceptable C compiler found in $PATH, the compiler is wrong, need to install gcc-c++ compiler

Fourth Step error resolution Yum install gcc-c++ reinstall gcc-c++ Compiler

Fifth step: Make

Sixth step: Make install

Seventh step: renaming old python mv/usr/bin/python/usr/bin/python_old

Eighth step: Create a soft connection to the new Python point/usr/bin/python ln-s/usr/local/python27/bin/python2.7/usr/bin/python

All code

wget HTTPS://WWW.PYTHON.ORG/FTP/PYTHON/2.7.12/PYTHON-2.7.12.TAR.XZ

TAR-XVF PYTHON-2.7.12.TAR.XZ

Mkdir/usr/local/python27

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

Make

Make install

Mv/usr/bin/python/usr/bin/python_old

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

Linux re-install Python

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.