How to install the Python development headers on Mac OS X?

后端 未结 2 1006
[愿得一人]
[愿得一人] 2020-12-08 10:04

For a project using Boost.Python (see this other question) I need the Python development headers containing e.g. pyconfig.h.

These are apparently missi

2条回答
  •  伪装坚强ぢ
    2020-12-08 10:41

    The latest Python 3 formula links a program called python3-config. You can use it to find the headers like this:

    python3-config --include

    On my machine, this outputs:

    -I/usr/local/Cellar/python3/3.3.4/Frameworks/Python.framework/Versions/3.3/include/python3.3m -I/usr/local/Cellar/python3/3.3.4/Frameworks/Python.framework/Versions/3.3/include/python3.3m
    

    You may need to brew update && brew rm python3 && brew install python3 to enable this.

    There is an equivalent program called python-config for Python 2.

提交回复
热议问题