how to upgrade python from 2.6 to 3.6

Hi Techrunnr subscribers, Here we will show you how to upgrade python from 2.6 to 3.6


Python is an interpreted high-level programming language for general-purpose programming. Created by Guido van Rossum and first released in 1991, Python has a design philosophy that emphasizes code readability, notably using significant whitespace.

It’s always necessary to upgrade software from lower version to latest for software dependency issue.

In Centos/Redhat
Install the dependency packages

yum -y groupinstall development

yum -y install zlib-devel

In Debian/Ubuntu

aptitude -y install gcc make zlib1g-dev

After that download the latest python and install the software.

To install Python 3.6, run the following commands:

wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz
tar xJf Python-3.6.3.tar.xz
cd Python-3.6.3
./configure
make
make install

Now check the version

which python3
python3 -V

Set python as default

remove existing python binary

which python
/usr/bin/python

 

rm /usr/bin/python

Create symbolic link to original Python

which python3
/usr/share/python3

 

ln -s /usr/share/python3 /usr/bin/python

Thats It!!!!

© 2018, Techrunnr. All rights reserved.

#1
#2
#3
Questions Answered
Articles Written
Overall Points
Categories: applicationLinux

Prabhin Prabharkaran

He is Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!!

Leave a Reply

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.