centos 升級python2.6 到python3.3

來源:互聯網
上載者:User

  Centos 6.5版本發布了,但是裡面使用的python卻是2.6.6的版本,對於想使用python新版本的朋友,可以自己升級python。 1.查看當前python的版本。

[root@localhost liukk]# pythonPython 2.6.6 (r266:84292, Nov 22 2013, 12:16:22) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> 
2. 安裝升級相應的軟體包。
 yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
3. 下載python 3.3 的源碼包。
[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.bz2Resolving mirrors.sohu.com... 119.188.36.70Connecting to mirrors.sohu.com|119.188.36.70|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 14122529 (13M) [application/octet-stream]Saving to: “Python-3.3.3.tar.bz2”58% [======================================================================================>                                                               ] 8,216,640    128K/s  eta 43s  

 4. 安裝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
  安裝完之後可以在/usr/local/src/python3.3/bin 目錄下看到python3.3 5. 配置python   
 mv /usr/bin/python /usr/bin/python.bak ln -s /usr/local/python3.3/bin/python3.3 /usr/bin/python

6. 查看當python的版本
[root@localhost bin]# pythonPython 3.3.3 (default, Dec 24 2013, 06:29:34) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linuxType "help", "copyright", "credits" or "license" for more information.>>> 

 至此,centos python3.3 版本安裝完畢,可以盡情遨遊python coding 了。
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.