CentOS 6 has Python 2.6.6 pre-installed which can’t be upgraded. Forcefully upgrading or replacing this version causes yum and many other utilities to break. In this tutorial we will install a new version of python using alternate install method. This will create a new python version in /usr/local.
Quick Reference:
Path | |
---|---|
Python installation dir | /usr/local/lib/python3.6 |
Python executable | /usr/local/bin/python3.6 |
Pip executable | /usr/local/bin/pip3.6 |
Step 1: System Package Installation
Install below pre-requisites:
|
|
Step 2: Downloading Python
Download python
|
|
Step 3: Python Alternate Installation
|
|
Step 4: Verifying new version
|
|
Shell Script Shortcut
Warning: Never run shell scripts downloaded from internet. Fork or download below script, review and keep your own local copy.
https://github.com/vinodpandey/scripts/blob/master/python3-centos-6.sh