CentOS下安裝Python

來源:互聯網
上載者:User

CentOS下安裝Python

在安裝python前需要安裝gcc

yum install gcc

在https://www.python.org/ftp/python/下找到您所需的python版本

如https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tgz

下載python

wget https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tgz

解壓編譯安裝

# tar zxvf Python-3.4.1.tgz


# cd Python-3.4.1.tgz

# ./configure

# make

# make install

 


此時,新版本的python沒有覆蓋原來的版本

vi /user/bin/yum

修改首行python變為python2.7

# mv /usr/bin/python  /usr/bin/python2.7

重建立立超連結

# ln -s "python下載編譯目錄" (空格)/usr/bin/python

再次開啟python則顯示新版本

# python

Python 3.4.1 (default, Aug 25 2014, 10:04:52)
Type "help", "copyright", "credits" or "license" for more information.
>>>

安裝成功!

下面關於Python的文章您也可能喜歡,不妨看看:

Linux下Python的安裝以及注意事項 

Ubuntu 14.04 下安裝使用Python rq模組 

無需作業系統直接運行 Python 代碼 

CentOS上源碼安裝Python3.4 

《Python核心編程 第二版》.(Wesley J. Chun ).[高清PDF中文版]

《Python開發技術詳解》.( 周偉,宗傑).[高清PDF掃描版+隨書視頻+代碼]

Python指令碼擷取Linux系統資訊

在Ubuntu下用Python搭建案頭演算法交易研究環境

Python 語言的發展簡史

Python 的詳細介紹:請點這裡
Python 的:請點這裡 

本文永久更新連結地址:

聯繫我們

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