終端直接輸入python 可查看當前使用的python版本 或者python --version 均可。
進入python安裝目錄,列出系統安裝的所有python版本
cd /usr/local/lib
ls
列出系統安裝的所有python版本
用 update-alternatives 來爲整個系統更改 Python 版本 :
update-alternatives --list python #羅列可用的python版本
若報錯,則python尚未鏈接至update-alternatives
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 #優先級爲1
update-alternatives --install /usr/bin/python python /usr/bin/python3.4 2 #優先級爲2
鏈接完成後,終端輸入
update-alternatives --config python
會顯示版本信息,根據相應編號進行選擇即可,若報錯權限不夠,在命令前加sudo即可。