I am trying to compile a simple "Hello, World!" in Cython. In a file I have:
print("Hello, World!")
I run:
cython hello_world.pyx
To get the hello_world.c
file. I then try:
gcc -c hello_world.c
Which gives the error:
fatal error: 'Python.h' file not found
Then I tried this:
gcc -c hello_world.c -framework Python
Didn't work. I had changed include "Python.h"
to <Python/Python.h>
and got a different error:
fatal error: 'longintrepr.h' file not found
Regardless, I want to use Python3, not the Python Apple ships with, but I am unable to figure out where the Python3 development headers are located.
Ultimately, I want to be able to compile hello_world.c
so that it works in a Python3 interpreter.
(I am using brew's python3.5.2_1, if that helps.)
Currently is /usr/local/Frameworks/Python.framework/Headers
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With