Install pyhash on Mac
July 02, 2012
由于工作开发环境的依赖,不得已弄了Mac上安装pyhash。
-
install boost http://www.boost.org/ currently 1.49.0 follow manual http://www.boost.org/doc/libs/1_49_0/more/getting_started/unix-variants.html/ notice
./bootstrap.sh --prefix=path/to/installation/prefix ./b2 install --prefix=path/to/installation/prefix
record the prefix
-
从 http://code.google.com/p/pyfasthash/downloads/list 下载解压源代码包后,尝试
python setup.py install
,如果有以下报错,则继续执行第三步:In file included from src/Hash.cpp:1: src/Hash.h:12:28: error: boost/python.hpp: No such file or directory src/Hash.h:13:41: error: boost/python/raw_function.hpp: No such file or directory In file included from src/Hash.cpp:1:
-
修改setup.py 在
include_dirs
和library_dirs
的声明之后添加:include_dirs += [ 'path/to/installation/prefix/include', ] library_dirs += [ 'path/to/installation/prefix/lib', ]
之后再执行。