如何在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>
错误
答案 0 :(得分:20)
我刚刚在OSX上安装了PyICU,因为同样的错误导致它失败了。这是我的建议:
brew install icu4c
#安装库;可能已经安装ls -l /usr/local/opt/icu4c/include/
brew remove icu4c
brew install icu4c
pip install polyglot
CFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib pip install polyglot
brew install 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
答案 1 :(得分:15)
brew install icu4c
brew link icu4c --force
答案 2 :(得分:0)
对我来说简单的回答只是brew install和链接不起作用所以我找到了下面的解决方案让它工作:
1)使用brew安装icu4c
:
brew install icu4c
2)检查版本:
ls /usr/local/Cellar/icu4c/
它提示类似于:
59.1
3)执行波纹管命令,替换上一步的正确版本(第一行只有整数部分,第二行和第三行带小数部分):
export ICU_VERSION=59
export PYICU_INCLUDES=/usr/local/Cellar/icu4c/59.1/include
export PYICU_LFLAGS=-L/usr/local/Cellar/icu4c/59.1/lib
4)最后为pyicu安装python包:
pip install pyicu