Upgrade Python from 2.6 to 2.7 on Centos 6.5
โพสต์: พฤหัสบดี 15 มี.ค. 2018 00:13
How can I upgrade it in Centos 6.5?
I try below
Download Python and extract it
Installation process
# Enter the directory:
# Run the configure:
# compile and install it:
# Checking Python version:
Python 2.7.8
export PATH="/usr/local/bin:$PATH"
กรณีที่ลง 2.7 แล้ว yum ไม่ได้ให้ทำดังนี้
change #!/usr/bin/python to #!/usr/bin/python2.6
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
# Enter the directory:
โค้ด: เลือกทั้งหมด
cd Python-2.7.8
โค้ด: เลือกทั้งหมด
./configure --prefix=/usr/local
โค้ด: เลือกทั้งหมด
make
make altinstall
โค้ด: เลือกทั้งหมด
python2.7 -V
export PATH="/usr/local/bin:$PATH"
กรณีที่ลง 2.7 แล้ว yum ไม่ได้ให้ทำดังนี้
โค้ด: เลือกทั้งหมด
vim `which yum`