+-
python – 在mac上安装libicu-dev
我如何在mac上安装libicu-dev.这是文档中建议的说明

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>

错误

最佳答案
我刚刚在OSX上安装了PyICU,因为同样的错误导致它失败了.这是我的建议:

>安装homebrew(OSX的包管理器)
> brew install icu4c#安装库;可能已经安装好了
>验证是否存在必要的包含目录:ls -l /usr/local/opt / icu4c / include /
>如果您没有该目录,则可能需要重新安装icu4u.我发现我必须做以下事情:

> brew删除icu4c
> brew安装icu4c

>尝试安装多语言以查看是否可以找到icu4c:pip install polyglot
>如果仍然抱怨,您可以尝试指定库位置:CFLAGS = -I /usr/local/opt / icu4c / include LDFLAGS = -L /usr/local/opt / icu4c / lib pip install polyglot

编辑:有进一步的变化.我目前安装icu的过程:

> brew安装icu4c
> brew link icu4c –force
> ICU_VERSION =< BREW_ICU_VERSION> CFLAGS = -I /usr/local/opt / icu4c / include LDFLAGS = -L /usr/local/opt / icu4c / lib pip install pyicu

点击查看更多相关文章

转载注明原文:python – 在mac上安装libicu-dev - 乐贴网