Installing python 3.6 on CentOS 7 / RHEL 7

CentOS and RHEL 7 have Python 2.7 available in the standard packages. You can install Python 3.6 from source while keeping the current 2.7 install on your machine, so any existing dependencies will not break.

yum install gcc
yum install zlib-devel
yum install openssl-devel
yum install sqlite-devel
cd /usr/src
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
tar xzf Python-3.6.1.tgz
cd Python-3.6.1
./configure
make altinstall
cd ..
rm Python-3.6.1.tgz

You can now run python3.6 and pip3.6 from your command line.

Leave a Reply

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

*