当前位置:首页 > 操作系统 > MacOs

python – 在mac上安装libicu-dev

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

<code>sudo apt-get install python-numpy libicu-dev
</code>

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

我正在使用anaconda但它似乎总是呕吐

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

错误

解决方法:

我刚刚在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


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐