centos安裝更新Python2.7以及pip的安裝

來源:互聯網
上載者:User

標籤:串連   有用   raw   2.7   python2.7   upd   ast   pip   mirrors   

一、首先對相關的軟體進行更新

python -V
yum -y update
yum groupinstall -y development
yum install -y zlib zlib-dev openssl openssl-devel sqlite sqlite-devel bzip bzip2-devel mysql-devel


二、安裝更新Python,並修改相關的配置資訊

wget http://mirrors.sohu.com/python/2.7.14/Python-2.7.14.tar.xz
tar -xvf Python-2.7.14.tar.xz
cd Python-2.7.14
./configure
make && make altinstall
mv /usr/bin/python /usr/bin/python2.6.6
ln -s /usr/local/bin/python2.7 /usr/bin/python
vi /usr/bin/yum(#!/usr/bin/python 改為 #!/usr/bin/python2.6.6)
因為yum依賴的是Python2.6,所以在更新之後不能夠使用,為瞭解決這個問題,將yum的配置串連依賴還是指向Python2.6 ,就是相當於安裝了兩個版本做不同的事情


三、安裝pip

pip的安裝主要是為了方便以後安裝軟體

wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-1.4.2.tar.gz
tar -xvf setuptools-1.4.2.tar.gz
cd setuptools-1.4.2
python setup.py install
ln -s /usr/local/bin/easy_install-2.7 /usr/bin/easy_install
easy_install pip
curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python2.7

因為有很多的軟體在使用的時候對2.7支援的還是比較穩定的,所以此時沒有用3.0

3.0也是以後的發展趨勢

centos安裝更新Python2.7以及pip的安裝

聯繫我們

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