Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

installing libicu-dev on mac

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

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>

error

like image 811
aceminer Avatar asked Oct 21 '15 12:10

aceminer


2 Answers

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

  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
  5. Try to install polyglot to see if it can find icu4c: pip install polyglot
  6. 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

EDIT: 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
like image 186
Jessamyn Smith Avatar answered Sep 19 '22 09:09

Jessamyn Smith


brew install icu4c
brew link icu4c --force

https://github.com/imojiengineering/node-icu-tokenizer

like image 24
Srinivas Nagamalla Avatar answered Sep 20 '22 09:09

Srinivas Nagamalla