Python Forum

Full Version: UnicodeDecodeError while installing polyglot
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Good day everyone. I'm installing polyglot for python 3.4.3 in windows 7 64 bit. Dependencies were installed already and when I installed  polyglot, I get an error below. Please help. This might sound very simple for you all but please bear with me, I'm just new to python and still learning. Your help will be much appreciated. Thank you.

Output:
C:\Python34\Scripts>pip install polyglot Collecting polyglot   Using cached polyglot-16.7.4.tar.gz     Complete output from command python setup.py egg_info:     Traceback (most recent call last):       File "<string>", line 1, in <module>       File "C:\Users\DRMS~1\AppData\Local\Temp\pip-build-8id__qnu\polyglot\setup .py", line 15, in <module>         readme = readme_file.read()       File "C:\Python34\lib\encodings\cp1252.py", line 23, in decode         return codecs.charmap_decode(input,self.errors,decoding_table)[0]     UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 4941:  character maps to <undefined>     ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in C:\Users\DRMS~1\A ppData\Local\Temp\pip-build-8id__qnu\polyglot\
A quick look at the documentation leads me to believe that this particular module is intended for Linux only and not for Windows.  This entry:

Quote:   File "C:\Python34\lib\encodings\cp1252.py", line 23, in decode
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]
    UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 4941:
 character maps to <undefined>

seems to indicate polyglot relies on utf-8 (which Linux supports natively), while your version of Windows currently supports cp1252 (code page 1252), which is not utf-8.

You might (and I stress 'might') be able to solve the problem by upgrading to Python v 3.6.0 (the latest version).  Again, this seems targeted for Linux, so even if the upgrade resolves this particular issue, there might be other problems do to differences in OS's.

There was this comment from the github site though:

Quote:valeriocos commented on Jul 31, 2015
Hi, I had some problems installing Polyglot on my Windows machine (I did not find any information for Windows distributions at http://polyglot.readthedocs.org/en/lates...ation.html).

I was able to make it run by downloading the following Windows Binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs/

NumPy
PyICU
PyCLD2
and installing them through the command line
pip install <name_of_the_binary>.whl

Good luck
Thank you for the reply sir. Yah, I was able to install it in windows 7 32 bit, some functionalities worked with windows but to good with NER. However, I'm planning to do the task with linux platform now. Thank you.