I wrote a small c program on RedHat:
#include <Python.h>
#include <stdio.h>
int main() {
printf("Hello, Python!\n");
return 0;
}
And got the following error:
main.c:1:20: fatal error: Python.h: No such file or directory
So I found the following answer: fatal error: Python.h: No such file or directory
Installed python-devel. I verify that /usr/include/python2.7/Python.h
exists, and still getting the same error.
Of-course when running gcc main.c -I/usr/include/python2.7/
everything compiles fine.
My question is:
Is it correct to add -I/usr/include/python2.7/
when compiling, or is there some kind of built-in env-variable that gcc should expect (something like PYTHON_DEV_HOME).
This is kinda strange question I believe, but the reason I'm asking is because I'm getting the same error for TensorFlow (git cloned), which should be compiling off the bat. Since it isn't, I assume my environment is missing somthing...