在Mac上安装libicu-dev [英] installing libicu-dev on mac

查看:141
本文介绍了在Mac上安装libicu-dev的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Mac上安装libicu-dev.这是文档上推荐的说明

how do i install libicu-dev on mac. This is the instruction recommended on the documentation

sudo apt-get install python-numpy libicu-dev

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

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

I am using anaconda but it seems to always throw up an

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上.这是我的建议:

I just got PyICU to install on OSX, after it was failing due to that same error. Here is what I recommend:

  1. 安装自制软件(用于OSX的软件包管理器)
  2. brew install icu4c#安装库;可能已经安装
  3. 验证是否存在必需的包含目录:ls -l /usr/local/opt/icu4c/include/
  4. 如果没有该目录,则可能需要重新安装icu4u.我发现我必须执行以下操作:
  1. Install homebrew (package manager for OSX)
  2. brew install icu4c # Install the library; may be already installed
  3. Verify that the necessary include directory is present: ls -l /usr/local/opt/icu4c/include/
  4. If you do not have that directory, you may need to reinstall icu4u. I found that I had to do the following:
  1. brew remove icu4c
  2. brew install icu4c
  1. brew remove icu4c
  2. brew install icu4c

  • 尝试安装polyglot以查看是否可以找到icu4c:pip install polyglot
  • 如果仍然有问题,您可以尝试指定库位置:CFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib pip install polyglot
  • Try to install polyglot to see if it can find icu4c: pip install polyglot
  • If that still complains, you can try specifying library location: CFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib pip install polyglot
  • 进行了进一步的更改.我当前的安装icu的过程:

    There have been further changes. My current process for installing icu:

    1. brew install icu4c
    2. brew link icu4c --force
    3. ICU_VERSION=<BREW_ICU_VERSION> CFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib pip install pyicu
    1. brew install icu4c
    2. brew link icu4c --force
    3. ICU_VERSION=<BREW_ICU_VERSION> CFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib pip install pyicu

    这篇关于在Mac上安装libicu-dev的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆