requests/requests-kerberos

Error installing on RHEL - src/kerberos.c:17:20: fatal error: Python.h: No such file or directory

Closed this issue · 1 comments

>pip3 install requests-kerberos
Collecting requests-kerberos
  Using cached https://files.pythonhosted.org/packages/ee/a2/866f2b9a60f75055137b9ad127033e397963b2c4769d4b5fab1c3c7e8be3/requests_kerberos-0.12.0-py2.py3-none-any.whl
Requirement already satisfied: requests>=1.1.0 in /usr/local/lib/python3.6/site-packages (from requests-kerberos)
Requirement already satisfied: cryptography>=1.3; python_version != "3.3" in /usr/local/lib64/python3.6/site-packages (from requests-kerberos)
Collecting pykerberos<2.0.0,>=1.1.8; sys_platform != "win32" (from requests-kerberos)
  Using cached https://files.pythonhosted.org/packages/9a/b8/1ec56b6fa8a2e2a81420bd3d90e70b59fc83f6b857fb2c2c37accddc8be3/pykerberos-1.2.1.tar.gz
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.6/site-packages (from requests>=1.1.0->requests-kerberos)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/lib/python3.6/site-packages (from requests>=1.1.0->requests-kerberos)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/site-packages (from requests>=1.1.0->requests-kerberos)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.6/site-packages (from requests>=1.1.0->requests-kerberos)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in /usr/local/lib64/python3.6/site-packages (from cryptography>=1.3; python_version != "3.3"->requests-kerberos)
Requirement already satisfied: six>=1.4.1 in /usr/local/lib/python3.6/site-packages (from cryptography>=1.3; python_version != "3.3"->requests-kerberos)
Requirement already satisfied: pycparser in /usr/local/lib/python3.6/site-packages (from cffi!=1.11.3,>=1.8->cryptography>=1.3; python_version != "3.3"->requests-kerberos)
Installing collected packages: pykerberos, requests-kerberos
  Running setup.py install for pykerberos ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-2v2e48js/pykerberos/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-rhs74ny0-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'kerberos' extension
    creating build
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c src/kerberos.c -o build/temp.linux-x86_64-3.6/src/kerberos.o -DGSSAPI_EXT
    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

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-2v2e48js/pykerberos/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-rhs74ny0-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-2v2e48js/pykerberos/

I have already tried

$ sudo yum install gcc python-devel krb5-devel krb5-workstation
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

Please help

This is an old ticket but you are trying to install this in a Python 3 environment but only have the python-devel packages which is the headers for Python 2 only. You need to install python3-devel to get the Python 3 headers files.