作者热门文章
- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
对于使用 Boost.Python 的项目(参见 this other question),我需要包含例如pyconfig.h
。
这些显然从我的系统中丢失。我已经通过 Homebrew 安装了 Python 3:
cls ~ $ brew info python3
python3: stable 3.3.0
http://www.python.org/
Depends on: pkg-config, readline, sqlite, gdbm
/usr/local/Cellar/python3/3.2.3 (4420 files, 78M)
/usr/local/Cellar/python3/3.3.0 (4843 files, 93M) *
https://github.com/mxcl/homebrew/commits/master/Library/Formula/python3.rb
我也希望通过 Homebrew 获取 header ,但我找不到它们的包。
cls ~ $ brew search python-dev
No formula found for "python-dev". Searching open pull requests...
我有哪些安装这些 header 的选项?有 Homebrew 包吗?
最佳答案
最新的 Python 3 公式链接了一个名为 python3-config
的程序。您可以使用它来查找这样的标题:
python3-config --include
在我的机器上,这个输出:
-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
您可能需要brew update && brew rm python3 && brew install python3
来启用此功能。
对于 Python 2,有一个名为 python-config
的等效程序。
关于python - 如何在 Mac OS X 上安装 Python 开发头文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15931331/
我是一名优秀的程序员,十分优秀!