fatal error: Python.h: No such file or directory
I am trying to build a shared library using a C extension file but first I have to generate the output file using the command below:
I am trying to build a shared library using a C extension file but first I have to generate the output file using the command below:
I’d like to call a custom function that is defined in a Python module from C. I have some preliminary code to do that, but it just prints the output to stdout.
The question I’m about to ask seems to be a duplicate of Python’s use of __new__ and __init__?, but regardless, it’s still unclear to me exactly what the practical difference between __new__ and __init__ is.
Basically there seems to be massive confusion/ambiguity over when exactly PyEval_InitThreads() is supposed to be called, and what accompanying API calls are needed. The official Python documentation is unfortunately very ambiguous. There are already many questions on stackoverflow regarding this topic, and indeed, I’ve personally already asked a question almost identical to this one, so I won’t be particularly surprised if this is closed as a duplicate; but consider that there seems to be no definitive answer to this question. (Sadly, I don’t have Guido Van Rossum on speed-dial.)