Centos6.8安裝python環境

一.安裝步驟
1.檢查系統python
CentOS 6.8自帶的是Python 2.6.6,yum中最新的也是Python 2.6.6,只能下載Python 2.7.12的源代碼自己編譯安裝。如下圖:
Centos6.8安裝python環境

  1. 安裝Development tools
    #yum -y groupinstall "Development tools"
    Centos6.8安裝python環境
  2. 安裝編譯Python需要的包
    #yum install zlib-devel -y
    Centos6.8安裝python環境
    #yum install bzip2-devel -y
    Centos6.8安裝python環境
    #yum install openssl-devel -y
    Centos6.8安裝python環境
    #yum install ncurses-devel -y
    Centos6.8安裝python環境
    #yum install sqlite-devel -y
    Centos6.8安裝python環境
    #yum install tcl-devel –y

#yum install tk-devel -y
4.下載並解壓Python 2.7.12的源代碼
#cd /opt
#wget --no-check-certificate https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz
#tar xf Python-2.7.12.tar.xz
#cd Python-2.7.12
Centos6.8安裝python環境
#tar xf Python-2.7.12.tar.xz
#cd Python-2.7.12
Centos6.8安裝python環境

  1. 編譯與安裝Python 2.7.12
    #./configure --prefix=/usr/local
    #make && make install
    6.將python命令指向Python 2.7.12

    cd /usr/bin

#rm –rf python

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

#python –version
Centos6.8安裝python環境
由上圖所示 python2.7安裝完成

如果對此有興趣,請掃下面二維碼免費獲取更多詳情

Centos6.8安裝python環境

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章