1. 程式人生 > >Centos6.8安裝python環境

Centos6.8安裝python環境

python png ftp 新的 get process cer a20 open

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

  1. 安裝Development tools
    #yum -y groupinstall "Development tools"
    技術分享圖片
  2. 安裝編譯Python需要的包
    #yum install zlib-devel -y
    技術分享圖片
    #yum install bzip2-devel -y
    技術分享圖片
    #yum install openssl-devel -y
    技術分享圖片
    #yum install ncurses-devel -y
    技術分享圖片
    #yum install sqlite-devel -y
    技術分享圖片
    #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
技術分享圖片
#tar xf Python-2.7.12.tar.xz
#cd Python-2.7.12
技術分享圖片

  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
技術分享圖片
由上圖所示 python2.7安裝完成

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

技術分享圖片

Centos6.8安裝python環境