CentOS安裝python3

來源:互聯網
上載者:User

標籤:python3   linux   centos   

    剛接觸python,看到好多再爭論python2,Python3,我也不知道哪個好,因為自己看的書作者建議學習python3,所以我也就不管它誰好不好,就直接跟著作者開始吧。centos預裝的是Python2所以需要兩個版本同時存在,這裡採用源碼安裝,Python2 已知yum會用到,其他不知。

    1、下載python源碼包,www.python.org

    2、上傳到虛擬機器,直接,wget也可以

    3、tar  xvf  Python-3.6.0a1.tar.xz      #解壓

    4、mkdir -p  /applications/python            #把所有源碼安裝的軟體都放在/applications 

            cd Python-3.6.10a1       

          ./configure --prefix=/applications/python    

            make && make install 

            mv  /usr/bin/python  /usr/bin/python2.6

            ln -s /applications/python/bin/python3.6  /usr/bin/python



完成之後執行 python  就是python3

本文出自 “學習記錄” 部落格,請務必保留此出處http://674564591.blog.51cto.com/12568986/1974265

CentOS安裝python3

聯繫我們

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