升級 Python到2.7 並安裝 IPython

來源:互聯網
上載者:User

 ㈠ Python 依賴包


# rpm -q gcc gdbm-devel readline-devel ncurses-devel zlib-devel bzip2-develsqlite-devel db4-devel openssl-devel tk-devel bluez-libs-devel make --qf '%{name}.%{arch}\n'|sort

     ㈡ 安裝 Python 2.7
        
        
        # wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
        # tar -zxv -f Python-2.7.3.tar.bz2
        # cd Python-2.7.3
        # ./configure
        # make && make install
        # cd /usr/local/lib/python2.7  /*預設安裝目錄在/usr/local/lib/python2.7*/
        # /usr/local/bin/python -V     /*查看一下剛才安裝的版本 /usr/local/bin/python -V,看到了 2.7*/
        # mv /usr/bin/python /usr/bin/python.bak /*備份!!!*/
        # ln -sf /usr/local/bin/python2.7 /usr/bin/python /*把系統預設的Python指向剛才安裝的Python2.7*/
        # python -V
        
        使用yum的話會發現出錯,這是因為yum 依賴2.4.3而現在預設的 Python 版本是 2.7
        # yum list | grep gcc

There was a problem importing one of the Python modulesrequired to run yum. The error leading to this problem was:   No module named yum

        # vim /usr/bin/yum
        將首行顯示的 #!/usr/bin/python 修改為 #!/usr/bin/python2.4或者2.3、總之、自己要去/usr/bin目錄下實地考察、確認是哪個才行、網上都是2.4啊、這估計是抄來抄去的結果

     ㈢ 安裝 IPython
     
        
        # wget http://archive.ipython.org/release/0.13.2/ipython-0.13.2.tar.gz
        # tar -zxv -f ipython-0.13.2.tar.gz
        # cd ipython-0.13.2
        # python setup.py install  /*這裡需要注意的是、Python的版本最好比較高、否則這步容易出錯*/
        # ln -sf /usr/local/bin/ipython /usr/bin/ipython /*做不做無所謂*/

By David Lin

2013-06-25

Good Luck

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.