Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find python header path from within python?

What is the equivalent of

numpy.get_include()

as used here for Python, giving me the path to the directory where the Python header files are located?

like image 744
Woltan Avatar asked Jan 17 '13 08:01

Woltan


People also ask

Where is Python header file located?

The header files are typically installed with Python. On Unix, these are located in the directories prefix/include/pythonversion/ and exec_prefix/include/pythonversion/ , where prefix and exec_prefix are defined by the corresponding parameters to Python's configure script and version is '%d. %d' % sys.


1 Answers

The header files are in include directory.

You can find the include dir using the distutils.sysconfig module

from distutils.sysconfig import get_python_inc
get_python_inc() #this gives the include dir

You can read about it here

like image 85
iamkhush Avatar answered Sep 23 '22 06:09

iamkhush