Install PolyGlot on Mac

Written by pradyumnadoddala | Published 2016/03/10
Tech Story Tags: mac | polyglot | install-polyglot-on-mac | install-polyglot | polyglot-on-mac

TLDRvia the TL;DR App

Why PolyGlot ?

I always have something to do with some software, because a good software engineer always uses the libraries that exists rather than recreating them.

I started working with NLP again but this time, I chose Python for my tasks, so after going to some Githubbing (I don't know if that's actually a word, here I go I’ve created a lexicon) PolyGlot seems to be a good library to do most of the NLP tasks.

Here is an installation guide (With error handling)

  • Try installing polyglot using pip

$ pip install polyglot

  • If you see an error like the below image

It means, you are missing the icu4c library.

Many OS do not provide full support for Unicode and standards-compliant text handling services and as we are dealing with NLP library which require these services.

  • First let us install the icu4c library using brew.

$ brew install icu4c

  • Check installation using

$ ls -l /usr/local/opt/icu4c/include/

Now install pyicu

$ CFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib pip install pyicu

Now the final command

$ pip install polyglot

References

http://polyglot.readthedocs.org/en/latest/Installation.htmlhttp://stackoverflow.com/questions/33259191/installing-libicu-dev-on-machttps://github.com/Homebrew/homebrew/issues/34170

Follow @pradyumna_d on Twitter for more..


Published by HackerNoon on 2016/03/10