CentOS Upgrade python2.6 to python3.3

Source: Internet
Author: User
Tags bz2

Centos 6.5 has been released, but Python is a 2.6.6 version, and you can upgrade Python yourself for friends who want to use a new version of Python. 1. View the current version of Python.

[root@localhost liukk]# python
python 2.6.6 (r266:84292, Nov 2013, 12:16:22) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7 -4)] on linux2
Type ' help ', ' copyright ', ' credits ' or ' license ' for the more information.
2. Install and upgrade the appropriate package.
Yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
3. Download the Python 3.3 source pack.
[Root@localhost liukk]# wget http://mirrors.sohu.com/python/3.3.3/Python-3.3.3.tar.bz2
--2013-12-24 06:10:56--  http://mirrors.sohu.com/python/3.3.3/Python-3.3.3.tar.bz2
Resolving mirrors.sohu.com ... 119.188.36.70
connecting to mirrors.sohu.com|119.188.36.70|:80 ... connected
. HTTP request sent, awaiting response ... OK
length:14122529 (13M) [Application/octet-stream]
saving to: "python-3.3.3.tar.bz2"

58% [========= =============================================================================>                                                               ] 8,216,640    128K/s  ETA 43s  

4. Install python3.3
Tar jxvf python-3.3.3.tar.bz2-c/usr/local/src/
  cd/usr/local/src/python-3.3.3/
  ./configure--prefix=/usr /local/python3.3 make
  && make install
After installation, you can see the python3.3 in the/usr/local/src/python3.3/bin directory. 5. Configure Python
Mv/usr/bin/python/usr/bin/python.bak
 ln-s/usr/local/python3.3/bin/python3.3/usr/bin/python

6. View the version of Python
[root@localhost bin]# python
python 3.3.3 (default, Dec 2013, 06:29:34) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] On Linux
Type ' help ', ' copyright ', ' credits ' or ' license ' for the more information.

At this point, CentOS python3.3 version installed, you can roam the python coding.
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.