I'm trying to install a local Python package on Scientific Linux 7.9, Python version 3.8. The package contains Cython so needs Python headers to build. This is installed and is on the include path, but gcc is still claiming it can't find it. Is this a permissions issue?
$ python setup.py install
running install
...
building 'farm.rasters.water_fill' extension
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 -I/opt/rh/rh-python38/root/usr/include -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 -I/opt/rh/rh-python38/root/usr/include
-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/home/jon/.jenkins/workspace/Farmmap_revision_linux_py36/TOXENV/py38/venv/lib64/python3.8/site-packages/numpy/core/include
-I/home/jon/.jenkins/workspace/Farmmap_revision_linux_py36/TOXENV/py38/venv/include
-I/opt/rh/rh-python38/root/include/python3.8 -c farm/rasters/water_fill.c
-o build/temp.linux-x86_64-3.8/farm/rasters/water_fill.o
farm/rasters/water_fill.c:19:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
I have installed rh-python38-python-devel, which includes the headers and they are in the -I path given above.
$ ls -l /opt/rh/rh-python38/root/usr/include/python3.8/
...
-rw-r--r--. 1 root root 3615 Jun 28 11:08 Python.h
Do I just need to chown this directory? I haven't needed to do this on other machines I have installed the package on.