CentOS Upgrade Python (upgrade from 2.6.6 to 2.7.8)

Source: Internet
Author: User

* * * Install ReadLine First, otherwise python fallback and arrow keys cannot be used after upgrade Yum Install readline-devel.x86_641. #wget www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz2. #tar zxvf python-2.7.8.tgz
3. #cd Python-2.7.8
Build a folder in/usr/local before compiling python27

4.#./configure--enable-shared--prefix=/usr/local/python27 If there is an error no acceptable C compiler found in $PATH, install GCC: #yum Install GCC
#make
#make Install

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

Link to build a new version of Python
#ln-S/usr/local/python27/bin/python2.7/usr/bin/python #ln-S/usr/local/python27/lib/libpython2.7.so/usr/lib64/ Libpython2.7.so (64-bit system)
#ln-S/usr/local/python27/lib/libpython2.7.so/usr/lib/libpython2.7.so (32-bit system) This time Yum becomes unavailable, to modify Yum, Modify Python to the original old version #vi/usr/bin/yum "#!/usr/bin/python" to "#!/usr/bin/python2.6" (then enter Python to view the information, if you are prompted for error while Loading shared Libraries:libpython2.7.so.1.0:cannot Open Shared object file:no such file or directory, workaround: #vi/etc/ld. so.conf.d/python2.7.conf Join/usr/local/python27/lib Save exit after execution #ldconfig) reference: http://www.linuxidc.com/Linux/2013-03/81117.htm

CentOS Upgrade Python (upgrade from 2.6.6 to 2.7.8)

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.