aboSamoor / polyglot

Multilingual text (NLP) processing toolkit
http://polyglot-nlp.com
Other
2.31k stars 337 forks source link

Polyglot import error on Ubuntu #89

Open salman-jpg opened 7 years ago

salman-jpg commented 7 years ago

Cannot run the examples on Jupyter notebooks.

ImportError: /home/usr/anaconda2/lib/python2.7/site-packages/_icu.so: undefined symbol: _ZTIN6icu_5514LEFontInstanceE

amirothman commented 7 years ago

looks like you're missing libicu-dev . On ubuntu/debian you can install it:

sudo apt-get update sudo apt-get install libicu-dev

salman-jpg commented 7 years ago

I have already tried this one. Just to make sure I uninstalled polyglot and installed it again. Still, the problem persists.

Here is the full error message:

`--------------------------------------------------------------------------- ImportError Traceback (most recent call last)

in () ----> 1 from polyglot.text import Text /home/usr/anaconda2/lib/python2.7/site-packages/polyglot/text.py in () 7 8 from polyglot.base import Sequence, TextFile, TextFiles ----> 9 from polyglot.detect import Detector, Language 10 from polyglot.decorators import cached_property 11 from polyglot.downloader import Downloader /home/usr/anaconda2/lib/python2.7/site-packages/polyglot/detect/__init__.py in () ----> 1 from .base import Detector, Language 2 3 __all__ = ['Detector', 'Language'] /home/usr/anaconda2/lib/python2.7/site-packages/polyglot/detect/base.py in () 9 10 ---> 11 from icu import Locale 12 import pycld2 as cld2 13 /home/usr/anaconda2/lib/python2.7/site-packages/icu.py in () 35 pass 36 ---> 37 from docs import * /home/usr/anaconda2/lib/python2.7/site-packages/docs.py in () 21 # ==================================================================== 22 ---> 23 from _icu import * 24 from _icu import _install__doc__ 25 ImportError: /home/usr/anaconda2/lib/python2.7/site-packages/_icu.so: undefined symbol: _ZTIN6icu_5514LEFontInstanceE`
marzenakrp commented 7 years ago

I am having the same problem (only on python 3.6). Any solutions?

File "", line 1, in File "/home/mara/anaconda3/lib/python3.6/site-packages/polyglot/text.py", line 11, in from polyglot.detect import Detector, Language File "/home/mara/anaconda3/lib/python3.6/site-packages/polyglot/detect/init.py", line 1, in from .base import Detector, Language File "/home/mara/anaconda3/lib/python3.6/site-packages/polyglot/detect/base.py", line 11, in from icu import Locale File "/home/mara/anaconda3/lib/python3.6/site-packages/icu/init.py", line 40, in from .docs import File "/home/mara/anaconda3/lib/python3.6/site-packages/icu/docs.py", line 23, in from _icu import ImportError: /home/mara/anaconda3/lib/python3.6/site-packages/_icu.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZTIN6icu_5714LEFontInstanceE

jamesdj commented 7 years ago

Same error here in Anaconda Python 3.6.

usptact commented 7 years ago

Bump. This issue still persists on Python 3.6.1

scorpionhiccup commented 7 years ago

Is there any resolution for this issue? I'm trying on virtualenv with python 2.7.12, and I'm getting the same error.

usptact commented 7 years ago

After many fiddling, I found that system ICU libs are not compatible with Anaconda's libs. The only setup that worked for me was Python 3.5, not in Anaconda!

scorpionhiccup commented 7 years ago

Thanks @usptact for your input, I also found that it works with python 3.5 on Ubuntu. Hope this issue is fixed for python 2.

snazari commented 6 years ago

Please fix this.

ZmeiGorynych commented 5 years ago

On Python 3.6, Ubuntu 16.04, I could make it work with conda install icu conda install -c conda-forge pyicu pip install pycld2 and then installing polyglot from source worked like a charm.

joausaga commented 4 years ago

On Python 3.6, Ubuntu 16.04, I could make it work with conda install icu conda install -c conda-forge pyicu pip install pycld2 and then installing polyglot from source worked like a charm.

This works for me for Python 3.7, SLES SP14. Thanks!