Python 2.7 on RHEL 6.4 Compute Node

Latest response

I'm trying to get Python 2.7 on RHEL 6.4 Compute Node and I've tried some ways but still having some issues and looking for the best way to do this. Here is what I tried...

wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz
tar xzf Python-2.7.13.tgz
cd Python-2.7.13
./configure
make altinstall

This got python 2.7 working but trying to import zlib showed it did not exist. So I then installed the zlib rpm and rebuilt python 2.7 which got zlib working.

Then I did "import socket" which worked but "socket.ssl" returned "'module' object has no attribute 'ssl'". So I'm starting to wonder if I needed to do this a certain way to get all "typical" python libraries included with a 2.7 install.

Does anyone know how to do this?

Thanks.
Mark

Responses

I don't know the answer to this question, but I may have a better solution.

We offer a pre-packaged Python 2.7 as part of Red Hat Software Collectons (RHSCL):

https://developers.redhat.com/products/softwarecollections/overview/

Software Collections are packages which you can install on top of RHEL which provide later versions of popular languages and packages, but are packaged specifically not to interfere with the system language which other OS components depend on (like don't go running EL6's yum on Python 2.7, bad things will happen). We'd like to think the software collections offer a superior experience to simply compiling the upstream source.

You can get access to RHSCL for no cost with a free developer subscription (see the very bottom of the above page), then if you like it and use it, you can buy production support on the RHSCL components with a paid RHSCL subscription.

Here's the product documentation if you'd like to read more about it:

https://access.redhat.com/documentation/en/red-hat-software-collections/

There's also an open source community around Software Collections, kinda like the CentOS/EPEL version of RHSCL. If you're happy to run community software which is not supplied or supported by Red Hat, here's the community Python 2.7 page:

https://www.softwarecollections.org/en/scls/rhscl/python27/

The packages are available in the CentOS Extras repo, or in the EL6 COPR repo linked towards the bottom of that page.

Thanks for the helpful response.

I followed the instructions on softwarecollections.org. Here is what I got:

sudo yum-config-manager --enable rhel-server-rhscl-7-rpms
Loaded plugins: product-id

sudo yum install python27
Loaded plugins: product-id, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
rhel-6-hpc-node-rpms                                             | 3.5 kB     00:00     
Setting up Install Process
No package python27 available.
Error: Nothing to do

I then tried installing epel with rpm -ivh epel-release-6-8.noarch.rpm but then I get this:

yum --enablerepo=epel info python27
Loaded plugins: product-id, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: epel. Please verify its path and try again

Am I doing this the best way and if so, what can I do about that error?

Thanks.

You need to either purchase Red Hat Software Collections add-on to get access to the channel, or add the correct repo to get access to the community package.

If using the community version, you'll also probably need to add EPEL: How to use Extra Packages for Enterprise Linux (EPEL)?

Anyone happen to know how I can resolve this error?

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.