Difference between revisions of "Updating Python RHEL6"

From LUG
Jump to navigation Jump to search
(Created page with "On RedHat Enterprise Linux 6.x the "default Python version is 2.6.X. Due to the fact that the RHEL package manager (YUM) is dependend on that version , it is not possible to u...")
 
 
Line 2: Line 2:
 
Due to the fact that the RHEL package manager (YUM) is dependend on that version , it is not possible to update this version.
 
Due to the fact that the RHEL package manager (YUM) is dependend on that version , it is not possible to update this version.
  
However!  There is an easy and save way to install Python 2.7 without "breaking" YUM.
+
However!  There is an easy and save way to install Python 2.7 (and/or 3.3 )without "breaking" YUM.
  
 
By using the RedHat Software Collections, which installs rpms and the supporting libraries in /opt, you can use a "higher" Python version.
 
By using the RedHat Software Collections, which installs rpms and the supporting libraries in /opt, you can use a "higher" Python version.
Line 14: Line 14:
  
 
  <nowiki>sudo sh -c 'wget -qO- http://people.redhat.com/bkabrda/scl_python27.repo >> /etc/yum.repos.d/scl.repo'</nowiki>
 
  <nowiki>sudo sh -c 'wget -qO- http://people.redhat.com/bkabrda/scl_python27.repo >> /etc/yum.repos.d/scl.repo'</nowiki>
 +
For Python 3.3 replace scl_python27 with scl_python33.repo
  
 
now you can install python 2.7:
 
now you can install python 2.7:
Line 23: Line 24:
 
  <nowiki>scl -l</nowiki>
 
  <nowiki>scl -l</nowiki>
 
  <nowiki>python27</nowiki>
 
  <nowiki>python27</nowiki>
 +
 +
  
 
Now it is possible to enable python 2.7 in your (bash) shell:
 
Now it is possible to enable python 2.7 in your (bash) shell:

Latest revision as of 13:40, 19 December 2017

On RedHat Enterprise Linux 6.x the "default Python version is 2.6.X. Due to the fact that the RHEL package manager (YUM) is dependend on that version , it is not possible to update this version.

However! There is an easy and save way to install Python 2.7 (and/or 3.3 )without "breaking" YUM.

By using the RedHat Software Collections, which installs rpms and the supporting libraries in /opt, you can use a "higher" Python version.

How to install this with a repository

First, install the Software Collection tools:

sudo yum install scl-utils

Now install a yum repo for Python .27 scl ( short for " Software Collection":

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

For Python 3.3 replace scl_python27 with scl_python33.repo

now you can install python 2.7:

sudo yum install python27

now we going to use the "Software Collection":

scl -l
python27


Now it is possible to enable python 2.7 in your (bash) shell:

 scl enable python27 bash 
 python -V 
 Python 2.7.x