1. 程式人生 > >Centos安裝Python2.7與2.6並存

Centos安裝Python2.7與2.6並存

1. 下載Python原始碼,

//下載原始碼 wget http://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz //解壓檔案 xz -d Python-2.7.13.tar.xz tar-xvf Python-2.7.13.tar //進入解壓後的資料夾 cdPython-2.7.13 //執行配置 ./configure--prefix=/usr/local //編譯和安裝 make make altinstall

2. 遇到問題,no compiler for c found in path

yum install gcc即可

3. 設定軟連線

?
1 ln-s /usr/local/bin/python2.7/usr/bin/python