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

后端 未结 2 999
[愿得一人]
[愿得一人] 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:28

    Are these the headers you are looking for:

    Cellar/python3/3.3.0//Frameworks/Python.framework/Versions/3.3/include/python3.3m/
    
    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题