Comments (38)
Please follow the installation instrcutions mentioned in the documentation
http://polyglot.readthedocs.org/en/latest/Installation.html
from polyglot.
@lukaskawerau try pip install pyicu
from polyglot.
for me work
pip3 install pyicu
pip3 install pycld2
from polyglot.
Fiedzia is right. The error refers to a Python module, but libicu-dev is a Linux dependency (you need both).
I've got rid of this error installing the package python3-icu.
Then another dependency error ocurred:
ImportError: No module named 'pycld2' (yes, I'd followed the installation instructions too).
Then I installed pycld2 with pip3 and everything went well.
from polyglot.
pip3 install -U git+https://github.com/aboSamoor/polyglot.git@master
This one worked out well for me
No need to downgrade or anything.
from polyglot.
In my case, the following packages were needed:
pip install pyicu
pip install pycld2
pip install morfessor
from polyglot.
@aboSamoor I have icu
installed (Gentoo system; so libraries and headers) and struck the same issue as others. It appears icu
(aka libicu
on Debian) is not the package that provides the icu
module in Python; pyicu
is.
emerge dev-python/pyicu
followed by pip3 install --user pycld2 morfessor
(since the latter two aren't in Gentoo repositories), cured the issue for me. I think pyicu
would be worth mentioning in your documents, as it seems it, not icu
itself, is the direct dependency.
Directing people at a document that clearly references the wrong dependency does not help. :-)
from polyglot.
conda install -c conda-forge pyicu
from polyglot.
Guys, I got the same issue. I found this great article and the problem was resolved: https://tobywf.com/2017/05/installing-pyicu-on-macos/
from polyglot.
I got it to work on anaconda with conda install -c conda-forge pyicu
from polyglot.
I had to do the following to get it to work;
python3.7 -m pip install polyglot
sudo apt-get install python3.7-numpy libicu-dev
sudo apt-get install python3.7-icu
python3.7 -m pip install morfessor
from polyglot.
Anaconda default icu's version is 54. There are problems when building pyicu with these libraries.
Update ICU to version 58:
conda install -c conda-forge icu=58.1
from polyglot.
Is this getting fixed? I'm trying to use polyglot with Anaconda and Python 3.5 and get the same error as above. The suggestions for installing python3-icu, pycld2 and icu=58.1 do not resolve the problem.
from polyglot.
Hi, on py2.7.12 ubuntu 16.04 I get the following error from polyglot.detect import Detector
:
ImportError: libicule.so.54: cannot open shared object file: No such file or directory
I have already tried conda install -c conda-forge icu=58.1
and reinstalling but this does not help.
Do you have any suggestions to solve this particular problem?
Otherwise could you suggest another workaround to get the language detector functionality?
Thanks!
from polyglot.
sudo apt-get install build-essential
pip install PyICU
Now, it's OK
from polyglot.
conda install -c conda-forge pyicu was the thing I needed to get past the icu step.
from polyglot.
@13muskanp your solution worked without facing any further issue. saved my day. thank you.
from polyglot.
Hello!
I stil get the same error
ImportError: cannot import name 'Locale' from 'icu'
I'm on Linux Manjaro so I wanted to know the equivalent for
libicu-dev
try the above hack which i have mentioned. that worked for me on several virtual envs.
from polyglot.
Please follow the installation instrcutions mentioned in the documentation
It doesn't help. ICU can't be installed: KeyError: 'ICU_VERSION'
from polyglot.
I had to do the following to get it to work;
python3.7 -m pip install polyglot sudo apt-get install python3.7-numpy libicu-dev sudo apt-get install python3.7-icu python3.7 -m pip install morfessor
Thank you! it has worked for me
from polyglot.
In case this can help anyone avoid a few hours of frustration, I wrote a quick tutorial on how I got it running in Docker.
from polyglot.
Hello!
I stil get the same error
ImportError: cannot import name 'Locale' from 'icu'
I'm on Linux Manjaro so I wanted to know the equivalent for
libicu-dev
Make sure PyICU is installed in the correct location. I accidentally installed it via sudo and it took me a lot of time to fix.
First, remove any traces of ICU with sudo pip uninstall pyicu
and pip uninstall pyicu
If you want to download whatever's latest, clear pip's cache via pip cache purge
Then reinstall it with pip install pyicu
.
from polyglot.
pyICU can be quite tricky because it should be installed to use a particular version of ICU, and this depends on each operating system. Incompatibility problems like the famous "undefined symbol" are, as I understand, related to the difference of versions between the operating system and the python library.
In addition, Anaconda makes things easier but there's an exception with these libraries.
This is my comment about Anaconda's installation but actually the same thing: #78 (comment)
from polyglot.
What worked for me was downloading the polyglot master file as well as the correct pycld2 and pyicu .whl files from https://www.lfd.uci.edu/~gohlke/pythonlibs/, then doing pip install pycld2-0. ... .whl and pip install pyicu- ... .whl, then navigating inside polyglot-master and doing python setup.py install.
from polyglot.
@lukaskawerau try
pip install pyicu
It is still not working for me. pip install pyicu
only works with sudo
and I have installed everything but still see this error.
from polyglot.
Installing pyicu
also worked for me. It would have helped a lot if the dependency mentioned in the error message would have been pyicu
rather than just icu
. (Also, this dependency should of course have been installed when I installed polyglot in the first place.)
from polyglot.
If you are running on Debian/Ubuntu and using python3, try:
pip install PyICU
from polyglot.
If you are running on Debian/Ubuntu and using python3, try:
pip install PyICU
RuntimeError:
Please set the ICU_VERSION environment variable to the version of
ICU you have installed.
from polyglot.
Why won't anyone add it to the requirements?
from polyglot.
在linux环境安装polyglot:
- 更新setuptools:pip3 install -U setuptools
- 安装polyglot:pip3 install polyglot -i https://mirrors.aliyun.com/pypi/simple
- 安装libicu-dev:sudo apt-get install python-numpy libicu-dev
- 安装pyicu:pip3 install pyicu -i https://mirrors.aliyun.com/pypi/simple
- 安装pycld2:pip3 install pycld2 -i https://mirrors.aliyun.com/pypi/simple
- 安装morfessor:pip3 install morfessor -i https://mirrors.aliyun.com/pypi/simple
from polyglot.
There's a simple hack to tackle this problem. -> Downgrade your pyicu version.
pyicu V2.3.1 worked for me, and i believe it will also work for most of you.
try this:
pip install polyglot
sudo apt-get install python-numpy libicu-dev
pip install pyicu==2.3.1
pip install morfessor
It definitely worked for me.
from polyglot.
Hello!
I stil get the same error
ImportError: cannot import name 'Locale' from 'icu'
I'm on Linux Manjaro so I wanted to know the equivalent for libicu-dev
from polyglot.
Hello!
I stil get the same error
ImportError: cannot import name 'Locale' from 'icu'
I'm on Linux Manjaro so I wanted to know the equivalent for libicu-dev
@renorosgon
On RHEL I installed libicu-devel
, there is likely a package with a similar name for your distribution.
from polyglot.
This code below works on Google Colab
!pip install polyglot
!sudo apt-get install python-numpy libicu-dev
!pip install pyicu==2.3.1
!pip install morfessor
!pip install pycld2
from polyglot.
If you have a Mac M1 or higher, you may need a few more steps before those presented by @Mika15.
You can take a look at the full process on this StackOverflow response.
from polyglot.
For me installing those requirements helped:
pycld2>=0.20
six>=1.7.3
futures>=2.1.6
sphinxcontrib-napoleon>=0.2.8
mock>=1.0.1
sphinx-bootstrap-theme>=0.4.5
alabaster>=0.7.1```
from polyglot.
Coming back to polyglot after a while and reading here and in other source following some installation errors I propose the following for Ubuntu (22.04.2 LTS):
Ubuntu/Linux packages
$ sudo apt-get install libicu-de pkg-config
Python libraries
'pip install polyglot pycld2 PyICU morfessor`
from polyglot.
sudo apt-get install libicu-de pkg-config
small typo, should read:
sudo apt-get install libicu-dev pkg-config
from polyglot.
Related Issues (20)
- Download Problem
- word.morphemes returns "ValueError: Package 'morph2.da ' not found in index" when script is run, but works when run interactively HOT 1
- UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 4941: character maps to <undefined>
- ImportError: cannot import name 'SIGPIPE'
- Egregious detections
- Polyglot Morfessor Models HOT 1
- installation error HOT 3
- Status of the project? HOT 3
- pip install polyglot error: subproc exit with error:
- English to Japanese Transliteration
- translate English into Chinese
- Underscores make sentences detected as English?
- [1] 7092 segmentation fault python - Error is coming HOT 2
- polyglot download failing HOT 2
- Licensing issue for polyglot
- kbnblnejcfcvlkihlvjilrubllivlibecclvteugcjvb
- Missing settings for data path for collections
- word arabic detect false positive
- list of supported languages
- list of supported languages about Tokenization!why 165 Languages
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polyglot.