Ubuntu 14.04編譯安裝python2.7.9
Ubuntu 14.04編譯安裝python2.7.9
請使用下面gist script, 執行時需要sudo這個script
然後發現系統的python2.7.6還是存在/usr/bin/python,
部份script指定這個路徑後依然跑舊的版本, 所以先備份2.7.6
sudo mv /usr/bin/python2.7 /usr/bin/python2.7.bak
接著設定新的為預設啟用
sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python2.7 2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7.bak 1
sudo update-alternatives --install /usr/bin/python2 python2 /usr/local/bin/python2.7 2
sudo update-alternatives --install /usr/bin/python2 python2 /usr/bin/python2.7.bak 1
sudo update-alternatives --install /usr/bin/python2.7 python2.7 /usr/local/bin/python2.7 2
sudo update-alternatives --install /usr/bin/python2.7 python2.7 /usr/bin/python2.7.bak 1
請使用下面gist script, 執行時需要sudo這個script
然後發現系統的python2.7.6還是存在/usr/bin/python,
部份script指定這個路徑後依然跑舊的版本, 所以先備份2.7.6
sudo mv /usr/bin/python2.7 /usr/bin/python2.7.bak
接著設定新的為預設啟用
sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python2.7 2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7.bak 1
sudo update-alternatives --install /usr/bin/python2 python2 /usr/local/bin/python2.7 2
sudo update-alternatives --install /usr/bin/python2 python2 /usr/bin/python2.7.bak 1
sudo update-alternatives --install /usr/bin/python2.7 python2.7 /usr/local/bin/python2.7 2
sudo update-alternatives --install /usr/bin/python2.7 python2.7 /usr/bin/python2.7.bak 1
留言