CentOS 6.5上安裝Python 2.7.9

來源:互聯網
上載者:User

標籤:

CentOS 6.6內建的是Python 2.6.6,而編譯llvm需要Python 2.7以上。

checking for python... /usr/bin/pythonchecking for python >= 2.7... not foundconfigure: error: found python 2.6.6 (/usr/bin/python); required >= 2.7

yum中最新的也是Python 2.6.6,只能下載Python 2.7.9的原始碼自己編譯安裝。

操作步驟如下:

1)安裝devtoolset

yum groupinstall "Development tools"

2)安裝編譯Python需要的包包

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

3)下載並解壓Python 2.7.9的原始碼

cd /optwget --no-check-certificate https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tar.xztar xf Python-2.7.9.tar.xzcd Python-2.7.9

4)編譯與安裝Python 2.7.9

./configure --prefix=/usr/localmake
make altinstall

5)將python命令指向Python 2.7.9

ln -s /usr/local/bin/python2.7 /usr/local/bin/python

6)檢查Python版本

shsh-4.1# python -VPython 2.7.9
 
 
轉載自:http://www.cnblogs.com/dudu/p/4294238.html

CentOS 6.5上安裝Python 2.7.9

相關文章

聯繫我們

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