Upgrade Python from 2.6 to 2.7 on Centos 6.5

ประเด็นที่เกี่ยวข้องกับการใช้งานและปัญหาซอฟต์แวร์ ของ CentOS
ตอบกลับ
รูปประจำตัวสมาชิก
slwt2002
Administrator
โพสต์: 126
ลงทะเบียนเมื่อ: พุธ 24 มิ.ย. 2015 18:03

Upgrade Python from 2.6 to 2.7 on Centos 6.5

โพสต์ โดย slwt2002 »

How can I upgrade it in Centos 6.5?

I try below

Download Python and extract it

โค้ด: เลือกทั้งหมด

wget http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz  
xz -d Python-2.7.8.tar.xz  
tar -xvf Python-2.7.8.tar
Installation process

# Enter the directory:

โค้ด: เลือกทั้งหมด

cd Python-2.7.8
# Run the configure:

โค้ด: เลือกทั้งหมด

./configure --prefix=/usr/local
# compile and install it:

โค้ด: เลือกทั้งหมด

make  
make altinstall
# Checking Python version:

โค้ด: เลือกทั้งหมด

python2.7 -V
Python 2.7.8
export PATH="/usr/local/bin:$PATH"

กรณีที่ลง 2.7 แล้ว yum ไม่ได้ให้ทำดังนี้

โค้ด: เลือกทั้งหมด

vim `which yum`
change #!/usr/bin/python to #!/usr/bin/python2.6
ไม่มีลายเซ็นต์ ขอเขียนแล้วกัน
ตอบกลับ