Python is one of the most famous and powerful languages used so in order to install or update it to 2.7 version following steps can be used.
Installing the Python2.7.
If its still showing older version add the new version as default.
Installing the pip2.7.
Installing dependencies or packages from pip2.7.
Installing the Python2.7.
[root@ip-10-0-1-55 ~]# yum install python27 python27-devel
[root@ip-10-0-1-55 ~]#
python --version Python 2.7.10
If its still showing older version add the new version as default.
[root@ip-10-0-1-55 ~]# alternatives --config python
There are 2 programs which provide 'python'.
+ 1 /usr/bin/python2.6
* 2 /usr/bin/python2.7
Enter to keep the current selection[+], or type selection number: 2
[root@ip-10-0-1-55 ~]# python --version
Python 2.7.10
Installing the pip2.7.
[root@ip-10-0-1-55 ~]# wget https://bootstrap.pypa.io/get-pip.py --2016-05-26 11:10:33-- https://bootstrap.pypa.io/get-pip.py Resolving bootstrap.pypa.io (bootstrap.pypa.io)... 103.245.222.175 Connecting to bootstrap.pypa.io (bootstrap.pypa.io)|103.245.222.175|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1524722 (1.5M) [text/x-python] Saving to: ‘get-pip.py’ 100%[=====================================================================>] 1,524,722 --.-K/s in 0.09s 2016-05-26 11:10:33 (16.2 MB/s) - ‘get-pip.py’ saved [1524722/1524722]
[root@ip-10-0-1-55 ~]# python2.7 get-pip.py Collecting pip Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB) 100% |████████████████████████████████| 1.2MB 675kB/s Collecting wheel Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB) 100% |████████████████████████████████| 71kB 7.1MB/s Installing collected packages: pip, wheel Successfully installed pip-8.1.2 wheel-0.29.0 [root@ip-10-0-1-55 dist-packages]# which pip2.7 /usr/bin/pip2.7
Installing dependencies or packages from pip2.7.
[root@ip-10-0-1-55 ~]# pip2.7 install asciitree
Collecting asciitree
Downloading asciitree-0.3.1.tar.gz
Building wheels for collected packages: asciitree
Running setup.py bdist_wheel for asciitree ... done
Stored in directory: /root/.cache/pip/wheels/10/14/df/88531e6ba23be75397d69921e580464f2850b6f45e982ac644
Successfully built asciitree
Installing collected packages: asciitree
Successfully installed asciitree-0.3.1