centos python2.6 升級到 python2.7

來源:互聯網
上載者:User

標籤:res   while   local   pack   install   aries   usr   sha   ssi   

基本環境

yum -y install wget gcc xz tar

安裝 zlib (如果不裝zlib setuptools可能報錯 "Compression requires the (missing) zlib module")

    1. wget http://prdownloads.sourceforge.net/libpng/zlib-1.2.11.tar.gz?download

 2. tar -xvf zlib-1.2.11.tar.gz 

 3. cd zlib-1.2.11  &&  ./configure && make && make install

 

安裝 python

1. wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz

2. xz -d Python-2.7.12.tar.xz && tar -xvf Python-2.7.12.tar 

3. cd Python-2.7.12 && ./configure && make && makeinstall

4. mv /usr/bin/python /usr/bin/python2.6.6

5. ln -s /usr/local/bin/python /usr/bin/python

6. vim /usr/bin/yum

7. 修改頭部 #!/usr/bin/python2.6.6

如果python 報錯”error while loading sharedlibraries: libpython2.7.so.1.0: cannot open shared object file: No such file ordirectory”

vim /etc/ld.so.conf 下一行加 /usr/local/lib  然後執行  /sbin/ldconfig -v

 

安裝 setuptools

1. wget https://pypi.python.org/packages/a9/23/720c7558ba6ad3e0f5ad01e0d6ea2288b486da32f053c73e259f7c392042/setuptools-36.0.1.zip#md5=430eb106788183eefe9f444a300007f0

2. unzip setuptools-36.0.1.zip && cd setuptools-36.0.1

3. python setup.py install

4. easy_install pip

 

 

http://blog.csdn.net/shaojunbo24/article/details/52300428

http://blog.csdn.net/ab198604/article/details/8681851

http://blog.csdn.net/laiahu/article/details/6903100

http://blog.csdn.net/shanliangliuxing/article/details/18499625

 

centos python2.6 升級到 python2.7

聯繫我們

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