1,下載源代碼
2.裝置
$ tar–jxvf Python-2 . 5 . 2 . tar . bz2
$ cd Python-2.5.2
$ ./配置
$ make
$進行安裝
3.試驗
在命令行輸入python,會出現python解釋器,說明已經正確安裝。
suse10或rhel5(es5)下,默認安裝python,但版本是2.4.x;安裝完成後,在shell中輸入它。
#python
您會發現顯示結果:
# python
Python 2.4.3 (#1,Dec 11 2006,11:38:52)
linux2上的[GCC 4.1.1 20061130(紅帽4.1.1-43)]
鍵入“幫助”、“版權”、“學分”或“許可證”以獲取更多信息。
& gt& gt& gt
版本還是2.4.x
解決方案:
#cd /usr/bin
#ll |grep python?//查看這個目錄下的python。
#rm -rf python
#ln -s前綴/Python-2.5.2/python。/python?//前綴為您解壓縮python目錄。
#python
# python
Python 2.5.2 (#1,Dec 11 2006,11:38:52)
linux2上的[GCC 4.1.1 20061130(紅帽4.1.1-43)]
鍵入“幫助”、“版權”、“學分”或“許可證”以獲取更多信息。
& gt& gt& gt
安裝測試完成。