一、從python官網上下載最新的python3版本python
wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz 測試
二、解壓tar包spa
tar -zxvf Python-3.5.1.tgzget
三、建立python3的安裝目錄(須要切換至root用戶)編譯
mkdir /opt/python3.5ftp
四、編譯安裝pythonpython3.5
./configure --prefix=/opt/python3.5下載
makedi
sudo make installmake
五、建立python3的連接
sudo ln -s /opt/python3.5/bin/python3.5 /usr/local/bin/python3
六、測試
python3 -V 顯示python版本爲3.5.1