installing libicu-dev on mac

brew install icu4c
brew link icu4c --force

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


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

for me the simple answer with just brew install and linking does not work so I found the below solution to make it works:

1) install icu4c with brew:

brew install icu4c

2) check the version:

ls /usr/local/Cellar/icu4c/

it prompts something like: 59.1

3) execute bellow commands with substitution of proper version from previous step (first line only integer part, second and third line with decimal part):

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) finally install python package for pyicu:

pip install pyicu