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

查看:27
本文介绍了在 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>

错误

推荐答案

我刚刚在 OSX 上安装了 PyICU,因为同样的错误导致它失败.这是我推荐的:

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

  1. 安装 homebrew(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 删除 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
  • 有进一步的变化.我目前安装icu的过程:

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

    1. brew install icu4c
    2. brew link icu4c --force
    3. 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天全站免登陆