If you want to install Python 2.7 on Oracle Linux, you can proceed as follows:
Enable the Software Collection in /etc/yum.repos.d/public-yum-ol6.repo.
vim /etc/yum.repos.d/public-yum-ol6.repo
[public_ol6_software_collections]
name=Software Collection Library release 1.2 packages for Oracle Linux 6
(x86_64)
baseurl=[http://yum.oracle.com/repo/OracleLinux/OL6/SoftwareCollections12/x86_64/][1]
gpgkey=file:[///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle][2]
gpgcheck=1
enabled=1 <==============change from 0 to 1
After making this change to the yum repository you can simply run the yum command to install the Python:
yum install gcc libffi libffi-devel python27 python27-python-devel openssl-devel python27-MySQL-python
edit bash_profile with follow variables:
vim ~/.bash_profile
PATH=$PATH:$HOME/bin:/opt/rh/python27/root/usr/bin export PATH
LD_LIBRARY_PATH=/opt/rh/python27/root/usr/lib64 export LD_LIBRARY_PATH
PKG_CONFIG_PATH=/opt/rh/python27/root/usr/lib64/pkgconfig export PKG_CONFIG_PATH
Now you can use python2.7 and pip for install Python modules:
/opt/rh/python27/root/usr/bin/pip install pynacl
/opt/rh/python27/root/usr/bin/python2.7 --version