在Mac上安装libicu-dev

我如何在Mac上安装libicu-dev。 这是在文档上build议的说明

sudo apt-get install python-numpy libicu-dev 

http://polyglot.readthedocs.org/en/latest/Installation.html

我正在使用anaconda,但似乎总是抛出一个

 In file included from _icu.cpp:27: ./common.h:86:10: fatal error: 'unicode/utypes.h' file not found #include <unicode/utypes.h> 

错误

我刚刚得到PyICU安装在OSX上,因为同样的错误失败后。 这是我建议的:

  1. 安装自制软件 (OSX的软件包管理器)
  2. brew install icu4c #安装库; 可能已经安装
  3. 验证是否存在必需的包含目录: ls -l /usr/local/opt/icu4c/include/
  4. 如果您没有该目录,则可能需要重新安装icu4u。 我发现我必须做到以下几点:
    1. brew remove icu4c
    2. brew install icu4c
  5. 尝试安装polyglot,看看它是否能找到icu4c: pip install polyglot
  6. 如果仍然抱怨,可以尝试指定库位置: CFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib pip install polyglot
 brew install icu4c brew link icu4c --force 

https://github.com/imojiengineering/node-icu-tokenizer