ansible/event-driven-ansible

RHEL pip installation of python requirements fails for systemd-python

tombosmansibm opened this issue · 3 comments

Trying to install the python requirements in a Python (3.9) virtual environment fails on RHEL 8.8

pip install -r requirements.txt

Building wheels for collected packages: systemd-python
  Building wheel for systemd-python (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for systemd-python (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-39
      creating build/lib.linux-x86_64-cpython-39/systemd
      copying systemd/__init__.py -> build/lib.linux-x86_64-cpython-39/systemd
      copying systemd/journal.py -> build/lib.linux-x86_64-cpython-39/systemd
      copying systemd/daemon.py -> build/lib.linux-x86_64-cpython-39/systemd
      creating build/lib.linux-x86_64-cpython-39/systemd/test
      copying systemd/test/test_daemon.py -> build/lib.linux-x86_64-cpython-39/systemd/test
      copying systemd/test/test_journal.py -> build/lib.linux-x86_64-cpython-39/systemd/test
      copying systemd/test/test_login.py -> build/lib.linux-x86_64-cpython-39/systemd/test
      copying systemd/test/test_id128.py -> build/lib.linux-x86_64-cpython-39/systemd/test
      running build_ext
      building 'systemd/_journal' extension
      creating build/temp.linux-x86_64-cpython-39
      creating build/temp.linux-x86_64-cpython-39/systemd
      gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPACKAGE_VERSION=\"235\" -DLIBSYSTEMD_VERSION=239 -I/home/tbosmans/venveda/include -I/usr/include/python3.9 -c systemd/_journal.c -o build/temp.linux-x86_64-cpython-39/systemd/_journal.o -std=c99 -Werror=implicit-function-declaration
      systemd/_journal.c:21:10: fatal error: Python.h: No such file or directory
       #include <Python.h>
                ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for systemd-python
Failed to build systemd-python

It seems that systemd-python does not support RHEL .

Works with python3.6 ...

Pip needs python c headers.

Python.h: No such file or directory

You need to install python39-devel

Of course, how could I have missed that . Thanks.