基於 Python2.7 寫的,但是現在很多東西都是 Python3 的了.對於小白來說這無疑的致命的.哈哈哈 :arrow:
#依賴包
yum -y groupinstall "Development tools"
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
#下載 Python3
wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
#創建文件夾
mkdir /usr/local/python3
#解壓編譯安裝
tar -xvJf Python-3.6.2.tar.xz
cd Python-3.6.2
./configure --prefix=/usr/local/python3
make && make install
#給個軟鏈
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3