Embedding Python in Another Application tutorial problem

Hi, I am working on CentOS7 I am trying the 1.1 Very High Level Embedding I am using Python 3.7.3 (default, Mar 27 2019, 22:11:17) [GCC 7.3.0] :: Anaconda, Inc. on linux I created a file by pasting the tutorial code into original.c #define PY_SSIZE_T_CLEAN #include <Python.h> int main(int argc, char *argv[]) { wchar_t *program = Py_DecodeLocale(argv[0], NULL); if (program == NULL) { fprintf(stderr, "Fatal error: cannot decode argv[0]\n"); exit(1); } Py_SetProgramName(program); /* optional but recommended */ Py_Initialize(); PyRun_SimpleString("from time import time,ctime\n" "print('Today is', ctime(time()))\n"); if (Py_FinalizeEx() < 0) { exit(120); } PyMem_RawFree(program); return 0; } After executing: gcc -o original original.c original.c:2:20: fatal error: Python.h: No such file or directory #include <Python.h> ^ compilation terminated. What am I doing wrong? Is the tutorial complete? Thanks, Jesse

Hi Jesse,
#include <Python.h> ^ compilation terminated.
I'm not a centos user, and the message is very short, but I bet you've not installed the Python headers. It may be provided in a package like "python3-dev" (at least in Debian it's how it's called). It's probably not the right mailing list to ask for help though, as it does not look like a documentation issue, maybe try https://mail.python.org/mailman/listinfo/python-help? Bests, -- Julien Palard https://mdk.fr
participants (2)
-
Ibarra, Jesse
-
Julien Palard