For reasons I cannot fathom, it is very hard to install Python version 3 on RHEL7 - here is my work-around. and reminder for myself.
It seems I am not alone on this annoying RHEL 7 missing feature, so I thought I would share the solution.
- Note: Installing Python 3 on Ubuntu 16 or Ubuntu 18 takes about 3 seconds to install.
- Note: Only historic applications use Python 2.7 and around the web, you find lots of comments about ONLY writing Python version 3 from 2019 onwards.
So I need Python 3 on RHEL - I thought this install would take only a few seconds by using yum on Red Hat as I have the repositories already setup. But installing Python 3 on RHEL 7.6 - it took me about 2 hours of frustration. Python 2.7 was there in the initial installation. But I need to run and write Python 3.
Admittedly, I am using an unlicensed version of RHEL 7.6 on Power ppc64le:
- At IBM, we have a great agreement with Red Hat that for skills, education, and demonstrations then this is allowed.
- If IBM uses RHEL for production use, internally for running services or running it on behalf of a client, then the licenses and support are purchased.
- This is strictly enforced.
I am using RHEL 7.6 on a Power LPAR (VM) to test InfluxDB and Grafana handling njmon data - this is for demonstrations and encouraging clients to do the same on licensed RHEL. I really must have Python 3 for my project and we are not talking rocket-science or like this is unusual.
But I could not work out:
- Where the code is held? - which DVD image or repository
- How to install it? What the package is even called.
Eventually, I used the following found on two websites that reputable:
As root:
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum list "python3*"
yum install python36-rpm.ppc64le
python36 -m pip install --upgrade pip
python36 -m pip install influxdb
Questions:
- Why is Python 3 not on the basic installation media / DVD /.iso? It is a common requirement.
- Why do I have to use Fedora's repository? This just does not feel right.
- Why is this package called Python36? When I start Python 3 it says it is Python 3.6 (as expected).
- What are the Red Hat guys thinking when they make this installation so hard - a painful experience?
Note: The last two lines are to install the InfluxDB Python 3 client library, so I can inject njmon data into InfluxDB.
I really, don't understand why it is is so difficult. If you know why? Please comment.
I do note that:
- yum on RHEL7 is written in Python 2.7 (hence the default install) and
- yum on RHEL 8 is written in Python 3.6 (which is default installed).
So this problem disappears as we all use RHEL 8 in the future but RHEL 7 will be used for many years.
- - - The End - - -
Other places to find content from Nigel Griffiths IBM (retired)
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"Component":"","Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"HW1W1","label":"Power -\u003EPowerLinux"},"Component":"","Platform":[{"code":"PF016","label":"Linux"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"","label":""}},{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]