Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is this python36 version issue? How to resolve it?

I am on RHEL. I Installed python by following https://www.rosehosting.com/blog/how-to-install-python-3-6-4-on-centos-7/. I am getting an error when trying to install requests-kerberos

pip3 install requests-kerberos

returns

src/kerberos.c:17:20: fatal error: Python.h: No such file or directory
 #include <Python.h>
                    ^
compilation terminated.
error: command 'gcc' failed with exit status 1

sudo yum install gcc

Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager 
Package gcc-4.8.5-39.el7.x86_64 already installed and latest version 
Nothing to do

Then I tried

sudo yum install python3-devel

and got

  Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
No package python3-devel available.
Error: Nothing to do

Then I tried

sudo yum install python36-devel

and got

    Error: Package: python36-devel-3.6.8-2.el7.ius.x86_64 (ius)
           Requires: python36 = 3.6.8-2.el7.ius
           Installed: python3-3.6.8-10.el7.x86_64 (@rhel-7-server-rpms)
               python36 = 3.6.8-10.el7
           Available: python36-3.6.8-2.el7.ius.x86_64 (ius)
               python36 = 3.6.8-2.el7.ius
Error: Package: python36-devel-3.6.8-2.el7.ius.x86_64 (ius)
           Requires: python36-libs(x86-64) = 3.6.8-2.el7.ius
           Installed: python3-libs-3.6.8-10.el7.x86_64 (@rhel-7-server-rpms)
               python36-libs(x86-64) = 3.6.8-10.el7
           Available: python36-libs-3.6.8-2.el7.ius.x86_64 (ius)
               python36-libs(x86-64) = 3.6.8-2.el7.ius
like image 969
sam Avatar asked Feb 18 '26 07:02

sam


1 Answers

You are on RHEL, yet you follow a random Centos blog post. Below is a summary of some suggestions for a better python36 on both Centos and RHEL (6 or 7) from Red Hat Developers Blog:

  1. Enable SCL

    Software Collections are RedHat Satellite repositories that also work if your servers are air-gapped i.e. have no internet.

    On Centos:

    yum install centos-release-scl

    On RHEL7

    yum-config-manager --enable rhel-server-rhscl-7-rpms

  2. Install the main SCL package:

    yum install rh-python36

  3. Start using the Software Collection you just installed:

    scl enable rh-python36 bash

  4. Upgrade pip3 with itself, and update setuptools:

    pip3 install --upgrade pip

    pip3 install --upgrade setuptools

  5. Install requests-kerberos:

    pip3 install requests-kerberos

Notes:

    1. is equivalent to bash sourcing the file /opt/rh/rh-python36/enable
    1. installing the main packages is sufficient by having these:

rh-python36 dependencies (libs, headers, pip, setuptools)

like image 101
bbaassssiiee Avatar answered Feb 20 '26 18:02

bbaassssiiee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!