在Mac上安装PyMaxflow(提升问题)

时间:2013-11-18 22:44:01

标签: boost homebrew

我正在尝试在Mac(Mavericks)上安装PyMaxflow,这需要提升。我已经安装了自制软件,但构建文件仍无法找到它。有什么想法吗?

In file included from maxflow/src/_maxflow.cpp:317:
In file included from maxflow/src/fastmin.h:11:
In file included from maxflow/src/core/graph.h:48:
In file included from maxflow/src/core/../pyarray_index.h:5:
maxflow/src/pyarraymodule.h:12:10: fatal error: 'boost/mpl/clear.hpp' file not found
#include <boost/mpl/clear.hpp>
     ^
1 warning and 1 error generated.
error: command 'cc' failed with exit status 1
rrdhcp-10-33-45-150:PyMaxflow david$ open /usr
rrdhcp-10-33-45-150:PyMaxflow david$ open /usr
rrdhcp-10-33-45-150:PyMaxflow david$ brew install boost
Warning: boost-1.55.0 already installed
rrdhcp-10-33-45-150:PyMaxflow david$

1 个答案:

答案 0 :(得分:1)

运行setup.py install时,需要确保setup.py文件具有指向boost目录的正确路径。如果您打开该文件,您将看到如下所示的行:

maxflow_module [0] .include_dirs.append(numpy_include_dir)

这几乎包括你所有的“包含”目录:-)要正确包含你的boost目录,你只需要添加:

maxflow_module [0] .include_dirs.append(R “$ yourboostdirectory”)