Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does brew install the Python headers?

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.)

like image 813
Dair Avatar asked Oct 19 '22 02:10

Dair


1 Answers

Currently is /usr/local/Frameworks/Python.framework/Headers.

like image 57
WeZZard Avatar answered Oct 21 '22 06:10

WeZZard