CentOS 6.2安装Python2.7.3

首先查看当前系统中的python版本

系统默认python版本

1、安装开发工具

yum groupinstall "Development tools"

<p>
  2、安装其它需要的包
</p>

<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:9aaa0b69-d5e1-4858-98a4-bd5c951fcd90" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px">
  <pre style=" width: 640px; height: 25px;background-color:White;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;"><div>

<!–

Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/

–>

yum install zlib-devel bzip2-devel openssl-devel ncurses-devel

  <p>
    <!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div> 

    <p>
      
    </p>

    <p>
      3、下载并解压缩 Python2.7.3
    </p>

    <div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:496517a9-12e5-42b4-b6c7-ffe809258901" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px">
      <pre style=" width: 640px; height: 45px;background-color:White;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;"><div>

<!–

Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/

–>

wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2 tar -jxvf Python-2.7.3.tar.bz2