Centos上面默認的Python版本是2.6,本文介紹如何安裝3.4版本。
0.下載前准備
需要安裝以下庫,不然會有問題。
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
1. 下載Python3.4源碼
# wget http://mirrors.sohu.com/python/3.4.1/Python-3.4.1.tar.xz
2. 解壓縮並安裝
# xz -d Python-3.4.1.tar.xz # tar xf Python-3.4.1.tar -C /usr/local/src/ # cd /usr/local/src/Python-3.4.1/ # ./configure --prefix=/usr/local/python34 # make -j8 && make install
3. 安裝的目錄
默認情況下,python會安裝在
/usr/local/python34
4. 安裝you-get
pip3 install you-get
項目主頁:https://github.com/soimort/you-get
You-Get 主頁:https://you-get.org/
You-Get 原版中文說明:https://github.com/soimort/you-get/wiki/中文說明/
摘自:http://www.cnblogs.com/wardensky/p/4956056.html