Saturday, September 23, 2017

How to install Python in CentOS 6.5

Normally CentOS 6.5 have in build Python, you can check following commands

# cat /etc/redhat-release
CentOS release 6.5 (Final)

# /usr/bin/python -V
 Python 2.6.6

then you need to do

#yum -y update

#yum groupinstall "Development tools"

#yum install zlib-devel bzip2-devel openssl-devel ncurses ncurses-devel sqlite-devel readline-devel tk-devel

#wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz   => go to python download page and copy your required link and paste over here

# ls
anaconda-ks.cfg  post-install.log  Python-2.7.12.tgz

#tar -xzvf Python-2.7.12.tgz

#cd Python-2.7.12
#./configure --prefix=/usr/local
#make
#make altinstall

you can check your new version
# ls -la /usr/local/bin/python2.7*
-rwxr-xr-x. 1 root root 6294745 Aug 20 14:16 /usr/local/bin/python2.7
-rwxr-xr-x. 1 root root    1687 Aug 20 14:18 /usr/local/bin/python2.7-config

# /usr/local/bin/python2.7 --version
Python 2.7.12

No comments:

Post a Comment