polyglot icon indicating copy to clipboard operation
polyglot copied to clipboard

Polyglot import error on Ubuntu

Open salman-jpg opened this issue 8 years ago • 11 comments

Cannot run the examples on Jupyter notebooks.

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

salman-jpg avatar Feb 14 '17 05:02 salman-jpg

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

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

amirothman avatar Feb 21 '17 14:02 amirothman

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`

salman-jpg avatar Feb 22 '17 03:02 salman-jpg

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

marzenakrp avatar Jul 07 '17 05:07 marzenakrp

Same error here in Anaconda Python 3.6.

jamesdj avatar Aug 26 '17 01:08 jamesdj

Bump. This issue still persists on Python 3.6.1

usptact avatar Aug 31 '17 23:08 usptact

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

scorpionhiccup avatar Sep 19 '17 05:09 scorpionhiccup

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!

usptact avatar Sep 19 '17 07:09 usptact

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.

scorpionhiccup avatar Sep 19 '17 12:09 scorpionhiccup

Please fix this.

snazari avatar Feb 09 '18 00:02 snazari

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.

ZmeiGorynych avatar Dec 29 '18 13:12 ZmeiGorynych

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!

joausaga avatar Mar 27 '20 12:03 joausaga