How to install Python 3.6 on CentOS 7 (AWS, GCP)
Hello Friends,
Today, we are going to install Python 3.6 on RHEL Distribution (RHEL/CentOS)
In AWS EC2 default Python comes with instance are 2.7.5. So here we will install Python version3.6.0.
Step 1. There are some Pre-Requisites for this, here we will resolve that one by one.
Install the development, zlib-devel,openssl-devel
sudo yum -y groupinstall developmentsudo yum -y install zlib-develsudo yum -y install openssl-develInstall the PIP
curl -O https://bootstrap.pypa.io/get-pip.pyUse python to install pip
python get-pip.pyStep 2. After installed all the Pre-Requisite, here we need to install OpenSSL also to avoid the errors.
Download the package OpenSSL_1_0_2l, extract, configure and finally clean unnecessary files and folder
wget https://github.com/openssl/openssl/archive/OpenSSL_1_0_2l.tar.gztar -zxvf OpenSSL_1_0_2l.tar.gz
cd openssl-OpenSSL_1_0_2l/./config sharedmakesudo make installexport LD_LIBRARY_PATH=/usr/local/ssl/lib/cd ..rm OpenSSL_1_0_2l.tar.gzrm -rf openssl-OpenSSL_1_0_2l/Step 3. Here we will download, install and configure Python3
Download the Python 3.6.0 package, extract, configure and finally clean unnecessary files and folder
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xztar xJf Python-3.6.0.tar.xzcd Python-3.6.0./configuremakesudo make installcd ..rm Python-3.6.0.tar.xzsudo rm -rf Python-3.6.0Step 4. Now we create virtualenv running Python 3.6
sudo pip install --upgrade virtualenvvirtualenv -p python3 MYVENVsource MYVENV/bin/activatepython --version# Python 3.6.0Source: Github

 
 
