How to Install Python
How to Install Python? Python is a powerful programming language. It is very friendly and easy to learn. At writing time of this article Python 3.5.2 latest stable version is available to download and install. This article will help you to install Python 3.5.2 on your CentOS, Red Hat & Fedora Linux Server.
Install Python 3 on CentOS 7
1. First let’s start by ensuring your system is up-to-date.
yum -y update
yum groupinstall "Development tools"
2. Installing Python.
Method One: Build and Install Python3 from the Source
First thing to do is to go to Python’s download page and download the latest stable version of Python, At the moment of writing this article it is version 3.5.1:
Extract source archive and build:
tar xzf Python-3.5.1.tgz
Next, we are going to configure the installation directory on /usr/local, We can change the path:
Building and installing Python through below make altinstall command , this command will replace the python , which is using by the server:
You now should be all set to use your newly compiled python version:
How to check Python Version
# python3.5 –V
Method Two: Install Python3 from EPEL Repository
First, you need to enable EPEL repository on your system:
yum install epel-release
yum install python34
Method Three: Install Python3 from Software Collections (SCL)
The first step is to install the utilities needed to manage collections:
yum -y install scl-utils
Once you enable the SCL repository, go ahead and install python3 as follows:
yum -y install python33
Python 3.3 will become accessible by launching a new shell instance using the Software Collection scl command:
scl enable python33 bash
Additional Python libraries and tools, such as pip, can now be installed:
Congratulation’s! You have successfully installed Python. Thanks for using this tutorial for installing Python 3 on CentOS 7 system.