[New-bugs-announce] [issue26955] Implement equivalent to `pip.locations.distutils_scheme` in distutils

Sylvain Corlay report at bugs.python.org
Wed May 4 12:17:44 EDT 2016

New submission from Sylvain Corlay:

When installing a python package that has `headers`, these headers are usually installed under the main python include directory, which can be retrieved with `sysconfig.get_path('include')` or directly referred to as 'include' when setting the include directories of an extension module. 

However, on some systems like OS X, headers for extension modules are not located in under the python include directory (/usr/local/Cellar/pythonX/X.Y.Z/Frameworks/Python.framework/Versions/X.Y/include/pythonX.Y) but in `/usr/local/include/pythonX.Y`.

Is there a generic way to find the location where  headers are installed in a  python install?

pip.locations implements `distutils_scheme` which seems to be returning the right thing, but it seems to be a bit overkill to require pip. On the other side, no path returned by sysconfig corresponds to `/usr/local/include/pythonX.Y`

messages: 264836
nosy: sylvain.corlay
priority: normal
severity: normal
status: open
title: Implement equivalent to `pip.locations.distutils_scheme` in distutils
type: enhancement
versions: Python 3.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list