centos5.8 upgrade python2.4.3 to Python 2.7.8

Source: Internet
Author: User

Memo notes:

Yum-y groupinstall ' Development Tools '
Yum-y Install openssl-devel* ncurses-devel* zlib*.x86_64
Yum-y Install bzip2 bzip2-devel bzip2-libs

Download tar.gz file for Python 2.7.8

./configure--prefix=/usr/local/python && make && make install
Rm/usr/bin/python
Ln-s/usr/local/python/bin/python2.7/usr/bin/python

Verify $python-V

Solving the Yum failure problem

# Vim/usr/bin/yum
#!/usr/bin/python
Change into
#!/usr/bin/python2.4

-------------------------------

At the beginning of the installation of the python2.7.3, after successful installation, run Django Error:

Importerror:no module named _sqlite3

Follow the universal solutions on the Web:

Yum Install Sqlite-devel

and re-installed the python2.7.3, no use--prefix

But still did not solve this problem, always can not find python-2.7.3/lib/python2.7/lib-dynload/_sqlite3.so.

Personal suspicion is the version of Python 2.7.3.

So the installation of python2.7.8, still did not solve the problem, but there are python-2.7.8/lib/python2.7/lib-dynload/_sqlite3.so.

validation, import sys

Print Sys.path

See the referenced path is the path under/usr/local/lib, summed up the following point of view, if/usr/local/lib under Python, the system will automatically use this Python, Instead of using Python from the directory you--prefix installed to, you run python-v after you've built a soft connection to be the result.

Import Sqlite3 works correctly after removing all previously installed Python under/usr/local/.


centos5.8 upgrade python2.4.3 to Python 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.