🌐
GitHub
gist.github.com › dalegaspi › dec44117fa5e7597a559
Installing Python 2.7 on CentOS 6.5 · GitHub
sudo yum update # update yum sudo yum install centos-release-scl # install SCL sudo yum install python27 # install Python 2.7
🌐
Yandao
yandao.github.io › tutorial › 2016 › 04 › 11 › howto-install-python-27-on-centos-6x
How to Install Python 2.7 on CentOS 6.x
# Add the SCL repo $ sudo yum install -y centos-release-SCL # Install Python 2.7 $ sudo yum install -y python27
Discussions

python - How to install python27-devel on Centos 6.5 - Stack Overflow
I have installed python 2.7.6 from source, but can't find how to install python-devel for python 2.7 yum install python27-devel doesn't work. How to install it? More on stackoverflow.com
🌐 stackoverflow.com
On linux SUSE or RedHat, how do I load Python 2.7 - Stack Overflow
Can someone provide the steps needed to install python version 2.7 on SUSE and RedHat? It version that is on there is like 2.4 and I need to have it at at least 2.6 to make my script work. So afte... More on stackoverflow.com
🌐 stackoverflow.com
yum - Python 2.7 install on Scientific Linux 6 via SCL devtoolset - Unix & Linux Stack Exchange
Are you trying to install python-sopnet or just python 2.7.12? ... You should verify that python27 is coming from SCL and not elsewhere. In my case I am using CentOS 6, but the process is the same. ... $ yum info python27 Loaded plugins: fastestmirror, priorities Loading mirror speeds from ... More on unix.stackexchange.com
🌐 unix.stackexchange.com
July 29, 2016
linux - Centos Python2.7 YUM Dependency Resolution with Python2.7 - Stack Overflow
I can’t resolve python2.7 dependencies when yum installing particular packages. Using the SCL python27 - As far as I can tell, it only works with an SCL bash session and doesn’t resolve dependencies when using yum to install packages. More on stackoverflow.com
🌐 stackoverflow.com
February 24, 2019
🌐
GitHub
github.com › nmilford › rpm-python27
GitHub - nmilford/rpm-python27: An RPM spec file build and alt-install Python 2.7 on RHEL.
sudo yum -y install tk-devel tcl-devel expat-devel db4-devel gdbm-devel sqlite-devel bzip2-devel openssl-devel ncurses-devel readline-devel · wget https://raw.github.com/nmilford/rpm-python27/master/python27.spec -O ~/rpmbuild/SPECS/python27.spec
Starred by 26 users
Forked by 29 users
Languages   Shell 100.0% | Shell 100.0%
🌐
Leifmadsen
blog.leifmadsen.com › blog › 2017 › 01 › 03 › installing-python-2.7-on-centos-6.x
Installing Python 2.7 on CentOS 6.x · Leif Madsen
January 3, 2017 - sudo yum update # update yum sudo yum install centos-release-scl # install SCL sudo yum install python27 # install Python 2.7
🌐
DataStax
docs.datastax.com › en › jdk-install › doc › jdk-install › installPython27RHEL.html
Install DataStax Enterprise 6.8 on Debian-based systems using APT | DataStax Docs
sudo yum install python27 · sudo scl enable python27 bash · Verify the update by checking the Python version again. Make sure the result is Python 2.7.x. After logging out or restarting, you must enable python 2.7: sudo scl enable python27 ...
🌐
GitHub
gist.github.com › Ch00k › 5b4653ebf2059577002e
Installing Python and creating a virtualenv (Linux, Mac OS X, Windows) · GitHub
sudo yum -y update sudo yum -y install centos-release-SCL # the package is part of CentOS Extras repository sudo yum -y install python27 source /opt/rh/python27/enable virtualenv my_venv source my_venv/bin/activate
🌐
GitHub
github.com › sclorg › rhscl-dockerfiles › blob › master › centos7.python27 › Dockerfile.rhel7
rhscl-dockerfiles/centos7.python27/Dockerfile.rhel7 at master · sclorg/rhscl-dockerfiles
yum install -y --setopt=tsflags=nodocs python27 python27-python-devel python27-python-setuptools python27-python-pip nss_wrapper && \
Author   sclorg
🌐
TecAdmin
tecadmin.net › install-python-2-7-on-centos-rhel
How to Install Python 2.7 on CentOS/RHEL 9/8 and Fedora
April 26, 2025 - yum install centos-release-SCL yum install python27 scl enable python27 bash · Reply · Nurlan on August 8, 2017 9:03 am · Thank YOu! Reply · Mannu Thareja on January 28, 2019 10:13 pm · Thanks, how to install pip? Reply · name on December 3, 2014 11:29 pm ·
Find elsewhere
🌐
Red Hat
access.redhat.com › solutions › 1519803
How to install pip on Red Hat Enterprise Linux? - Red Hat Customer Portal
August 5, 2024 - # subscription-manager repos --enable rhel-server-rhscl-7-rpms # yum install python27-python-pip · Switch to a normal user and check the pip · $ scl enable python27 bash $ which pip $ pip -V · Note: When you close the current bash you will ...
🌐
GitHub
gist.github.com › andriisoldatenko › 6d155ec6ca4fc9532bfc
Install local Python 2.7.10 on CentOS 7 · GitHub
# bash -x -e ./python2.7.sh 2>&1 | tee install_python.log # cat ./python2.7.sh TMP_PATH=/tmp/tmp_install_python # Versions section PYTHON_MAJOR=2.7 PYTHON_VERSION=$PYTHON_MAJOR.10 rm -rf $TMP_PATH mkdir -p $TMP_PATH cd $TMP_PATH # Update yum and libraries yum -y update yum groupinstall -y development yum install -y zlib-devel openssl-devel sqlite-devel bzip2-devel # Download and extract Python and Setuptools wget --no-check-certificate https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py wget --no-check-c
Top answer
1 of 11
128

Instructions to download source and install:

https://www.python.org/download/

NOTE: You should check for the latest version of python 2.7.x, as it gets updated frequently. Currently (Oct 2017), the latest version is 2.7.14 though this comment will get old and new versions likely will be released every 6 months or so.

wget https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tgz # Download
tar xvfz Python-2.7.14.tgz # unzip
cd Python-2.7.14 # go into directory
./configure
make # build
su # or 'sudo su' if there is no root user
make altinstall

(EDIT: make install -> make altinstall per Ignacio's comment).

2 of 11
13

RHEL 6.2 using (had Python 2.6, i need Python 2.7.3) So:

$ sudo sh -c 'wget -qO- http://people.redhat.com/bkabrda/scl_python27.repo >> /etc/yum.repos.d/scl.repo'

$ yum search python27
Loaded plugins: amazon-id, rhui-lb, security
scl_python27                                                                                                                                      | 2.9 kB     00:00     
scl_python27/primary_db                                                                                                                           |  38 kB     00:00     
========================================================================= N/S Matched: python27 =========================================================================
python27.i686 : Package that installs python27
python27.x86_64 : Package that installs python27
python27-expat-debuginfo.i686 : Debug information for package python27-expat
python27-expat-debuginfo.x86_64 : Debug information for package python27-expat
python27-python-coverage-debuginfo.i686 : Debug information for package python27-python-coverage
python27-python-coverage-debuginfo.x86_64 : Debug information for package python27-python-coverage
python27-python-debuginfo.i686 : Debug information for package python27-python
python27-python-debuginfo.x86_64 : Debug information for package python27-python
python27-python-markupsafe-debuginfo.i686 : Debug information for package python27-python-markupsafe
python27-python-markupsafe-debuginfo.x86_64 : Debug information for package python27-python-markupsafe
python27-python-simplejson-debuginfo.i686 : Debug information for package python27-python-simplejson
python27-python-simplejson-debuginfo.x86_64 : Debug information for package python27-python-simplejson
python27-python-sqlalchemy-debuginfo.i686 : Debug information for package python27-python-sqlalchemy
python27-python-sqlalchemy-debuginfo.x86_64 : Debug information for package python27-python-sqlalchemy
python27-runtime.i686 : Package that handles python27 Software Collection.
python27-runtime.x86_64 : Package that handles python27 Software Collection.
python27-babel.noarch : Tools for internationalizing Python applications
python27-build.i686 : Package shipping basic build configuration
python27-build.x86_64 : Package shipping basic build configuration
python27-expat.i686 : An XML parser library
python27-expat.x86_64 : An XML parser library
python27-expat-devel.i686 : Libraries and header files to develop applications using expat
python27-expat-devel.x86_64 : Libraries and header files to develop applications using expat
python27-expat-static.i686 : expat XML parser static library
python27-expat-static.x86_64 : expat XML parser static library
python27-python.i686 : An interpreted, interactive, object-oriented programming language
python27-python.x86_64 : An interpreted, interactive, object-oriented programming language
python27-python-babel.noarch : Library for internationalizing Python applications
python27-python-coverage.i686 : Code coverage testing module for Python
python27-python-coverage.x86_64 : Code coverage testing module for Python
python27-python-debug.i686 : Debug version of the Python runtime
python27-python-debug.x86_64 : Debug version of the Python runtime
python27-python-devel.i686 : The libraries and header files needed for Python development
python27-python-devel.x86_64 : The libraries and header files needed for Python development
python27-python-docutils.noarch : System for processing plaintext documentation
python27-python-jinja2.noarch : General purpose template engine
python27-python-libs.i686 : Runtime libraries for Python
python27-python-libs.x86_64 : Runtime libraries for Python
python27-python-markupsafe.i686 : Implements a XML/HTML/XHTML Markup safe string for Python
python27-python-markupsafe.x86_64 : Implements a XML/HTML/XHTML Markup safe string for Python
python27-python-nose.noarch : Discovery-based unittest extension for Python
python27-python-nose-docs.noarch : Nose Documentation
python27-python-pygments.noarch : Syntax highlighting engine written in Python
python27-python-setuptools.noarch : Easily build and distribute Python packages
python27-python-simplejson.i686 : Simple, fast, extensible JSON encoder/decoder for Python
python27-python-simplejson.x86_64 : Simple, fast, extensible JSON encoder/decoder for Python
python27-python-sphinx.noarch : Python documentation generator
python27-python-sphinx-doc.noarch : Documentation for python-sphinx
python27-python-sqlalchemy.i686 : Modular and flexible ORM library for python
python27-python-sqlalchemy.x86_64 : Modular and flexible ORM library for python
python27-python-test.i686 : The test modules from the main python package
python27-python-test.x86_64 : The test modules from the main python package
python27-python-tools.i686 : A collection of development tools included with Python
python27-python-tools.x86_64 : A collection of development tools included with Python
python27-python-virtualenv.noarch : Tool to create isolated Python environments
python27-python-werkzeug.noarch : The Swiss Army knife of Python web development
python27-python-werkzeug-doc.noarch : Documentation for python-werkzeug
python27-tkinter.i686 : A graphical user interface for the Python scripting language
python27-tkinter.x86_64 : A graphical user interface for the Python scripting language

  Name and summary matches only, use "search all" for everything.

EDIT:

CentOS 6.x: http://dev.centos.org/centos/6/SCL/x86_64/python27/

$ sudo sh -c 'wget -qO- http://dev.centos.org/centos/6/SCL/scl.repo >> /etc/yum.repos.d/scl.repo'
$ scl enable python27 'python --version'
python 2.7.5
$ scl enable python27 bash
$ python --version
Python 2.7.5
🌐
nixCraft
cyberciti.biz › nixcraft › howto › package management › rhel 8 install python 3 or python 2 using yum
RHEL 8 install Python 3 or Python 2 using yum - nixCraft
May 23, 2024 - Type the following yum command to install Python 3 on Red Hat Enterprise Linux version 8: sudo yum install python3 OR sudo yum module install python36 Verify installation by typing the type command/command command: $ type -a python3 python3 ...
🌐
GitHub
gist.github.com › cuibonobo › a81e3b4ae0125a681e1f
Install Python 2.7.15 on CentOS 6 · GitHub
April 14, 2017 - # Install dependencies yum groupinstall -y 'development tools' yum install -y zlib-devel bzip2-devel openssl-devel xz-libs wget # Download the Python source and unpack it wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz tar -xvzf ...
🌐
Medium
medium.com › @graghav › installing-python-2-7-on-centos-rhel-6-x-version-54e8404c9eb1
Installing Python 2.7 on CENTOS/RHEL 6.x version - graghav - Medium
October 31, 2020 - sudo yum install scl-utils sudo yum install centos-release-scl-rh sudo yum install python27 sudo scl enable python27 bash # Verify the update: python -V Python 2.7.8
🌐
GitHub
gist.github.com › guy4261 › 0e9f4081f1c6b078b436
Installing Python 2.7.9 on CentOS · GitHub
Installing Python 2.7.9 on CentOS. GitHub Gist: instantly share code, notes, and snippets.
Top answer
1 of 1
2

You should verify that python27 is coming from SCL and not elsewhere.

In my case I am using CentOS 6, but the process is the same.

So:

$ yum info python27  
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
6 packages excluded due to repository priority protections
Available Packages
Name        : python27
Arch        : x86_64
Version     : 1.1
Release     : 25.el6
Size        : 5.2 k
Repo        : centos-sclo-rh
Summary     : Package that installs python27
License     : GPLv2+
Description : This is the main package for python27 Software Collection.

We can see it comes from centos-sclo-rh and so is the right version.

We can install this. Because it's from SCL it will install into /opt/rh and this will not impact any other aspect of the OS:

$ sudo yum install python27
...
$ ls /opt/rh
python27

We can see the default python is still unchanged:

$ /usr/bin/python --version
Python 2.6.6

Now we need the scl command. This is from the scl-utils package, which you may need to install (yum install scl-utils).

$ scl enable python27 bash

This runs a new shell with the path changed:

$ scl enable python27 bash
bash-4.1$ echo $PATH
/opt/rh/python27/root/usr/bin:/usr/local/bin:/usr/bin/X11:/etc:/usr/local/sbin:/sbin:/usr/sbin
bash-4.1$ command -v python
/opt/rh/python27/root/usr/bin/python
bash-4.1$ python --version
Python 2.7.8

So enabling and running SCL does not impact the core OS; it won't break anything you normally run but allows for a newer version of python to be installed in parallel (in /opt/rh).

🌐
GitHub
gist.github.com › jnrbsn › 8062545
Install Python 2.7, easy_install, and pip on Amazon Linux · GitHub
To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters · Show hidden characters · Copy link · sudo yum install python34-pip ·
Top answer
1 of 2
2

I found a solution eventually.

The first 30 odd Google searches tell me to make and alt install python2.7 BUT after further searching, I found THIS which I thought was just instructions on how to enable the handy epel repo but it also includes instructions on how to install the IUS repo.

I didn't think the IUS repo was very handy (never heard of it before and wasn't mentioned in anything I'd read up to that point) but I was running out of ideas so I looked into it and installed it just to see what was available. Turns out, it has python27!

Below is what I did to install the IUS repo and python27:

Make sure you have the epel repo installed/enabled.

# wget https://centos6.iuscommunity.org/ius-release.rpm
# rpm -Uvh ius-release*.rpm
# yum install python27

Make sure it is installing from the @ius repo and not base or update. If not installing from ius, you will need to use —disablerepo='*' —enablerepo='ius' options for the yum install.

After the install, I had python2.7 alongside the system python2.6 and all my dependency issues were resolved.

Hope this helps someone else.

2 of 2
1

The response given by 'WhiteFile' helped me to resolve my python 2.6 (abi) issue. I was trying to install Cassandra 3.11 which having the dependency on python 2.7.x and I built it using make/make altinstall and changed the ~/bash_profile with alias and path but it did not help. I was still getting the following error

   [root@test~]# yum install cassandra
   Loaded plugins: fastestmirror
   Setting up Install Process
   Loading mirror speeds from cached hostfile
   * base: centos.myfahim.com
   * extras: centos.myfahim.com
   * updates: centos.myfahim.com
   Resolving Dependencies
   --> Running transaction check
   ---> Package cassandra.noarch 0:3.11.4-1 will be installed
   --> Processing Dependency: python(abi) >= 2.7 for package: cassandra-3.11.4-1.noarch
   --> Finished Dependency Resolution
   Error: Package: cassandra-3.11.4-1.noarch (cassandra)
          Requires: python(abi) >= 2.7
          Installed: python-2.6.6-66.el6_8.x86_64 (@anaconda-CentOS-201703281317.x86_64/6.9)
          python(abi) = 2.6
   You could try using --skip-broken to work around the problem
   You could try running: rpm -Va --nofiles --nodigest

The suggestion did not work as given by yum.

I followed the approach referred by 'WhiteFire' user but added one more error as shown below and I resolved it by adding one more command

warning: ius-release.rpm: Header V4 DSA/SHA1 Signature, key ID 9cd4953f: NOKEY 
error: Failed dependencies:
    epel-release = 6 is needed by ius-release-1.0-15.ius.centos6.noarch

I installed epel-release using yum

wget https://centos6.iuscommunity.org/ius-release.rpm
yum install  epel-release
rpm -Uvh ius-release*.rpm
yum install python27

I am yet to resolve the output from below command as it still refer python(abi) => 2.6

     rpm -q --provides python | grep abi