Install Python 3.5.6 on CentOS/RHEL 7/6

Python 3.5.6 is a new version of the language, which is incompatible with the 2.x line of releases. The language is mostly the same, but many details, especially how built-in objects like dictionaries and strings work, have changed considerably, and a lot of deprecated features have finally been removed. You can also know more features in python 3.5.6
Install Python

Python 3.5.6

See Also:

Step #1 Require Package

Firstly make sure that all require packages installed on your system. Use following command to install all packages:

# yum install gcc openssl-devel bzip2-devel

Step #2 Download Python 3.5.6

Download Python using following command and you can also download latest version from python official site.

# cd /opt
# wget https://www.python.org/ftp/python/3.5.6/Python-3.5.6.tgz

Step #3 Extract Archive and Compile

Use below commands to extract Python source code and compile it on your system using altinstall.

# tar xzf Python-3.5.6.tgz 
# cd Python-3.5.6
# ./configure
# make
# make install

If you want to used to prevent replacing the default python binary file /usr/bin/python then use mention steps.

# tar xzf Python-3.5.6.tgz 
# cd Python-3.5.6
# ./configure
# make altinstall

Step #4 Check the Python Version

Check the latest version installed of python using below command

# python3.5 -V
Or
# python3.5 --version
Python 3.5.6

Reference:

https://docs.python.org/3.5/

Enjoy it!

No Responses

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.