polyglot icon indicating copy to clipboard operation
polyglot copied to clipboard

Encoding error in installation (Windows 8.1)

Open yiwanlim opened this issue 8 years ago • 3 comments

Hi, I tried to install polygot python setup.py install (using python 3.5) but this error coming up C:\Users\AppData\Local\Programs\Python\Python35-32\lib\site-packages\ setuptools\dist.py:349: UserWarning: Normalizing '16.07.04' to '16.7.4' normalized_version, Traceback (most recent call last): File "setup.py", line 122, in <module> tests_require=test_requirements, File "C:\Users\lim yi wan\AppData\Local\Programs\Python\Python35-32\lib\site-p ackages\setuptools\__init__.py", line 129, in setup return distutils.core.setup(**attrs) File "C:\Users\lim yi wan\AppData\Local\Programs\Python\Python35-32\lib\distut ils\core.py", line 148, in setup dist.run_commands() File "C:\Users\lim yi wan\AppData\Local\Programs\Python\Python35-32\lib\distut ils\dist.py", line 955, in run_commands self.run_command(cmd) File "C:\Users\lim yi wan\AppData\Local\Programs\Python\Python35-32\lib\distut ils\dist.py", line 971, in run_command log.info("running %s", command) File "C:\Users\lim yi wan\AppData\Local\Programs\Python\Python35-32\lib\distut ils\log.py", line 44, in info self._log(INFO, msg, args) File "C:\Users\lim yi wan\AppData\Local\Programs\Python\Python35-32\lib\distut ils\log.py", line 32, in _log encoding = stream.encoding File "C:\Users\lim yi wan\AppData\Local\Programs\Python\Python35-32\lib\codecs .py", line 408, in __getattr__ return getattr(self.stream, name) AttributeError: '_io.BufferedWriter' object has no attribute 'encoding'

Would be appreciate if you can solve it. Sorry if anything unclearly stated as I'm new to python.

yiwanlim avatar Dec 23 '17 11:12 yiwanlim

I just tried setup.py build and setup.py install commands on my 64-bit Windows 10 with Python36 and the latest polyglot source and did not encounter any errors.

Did you use Windows Command Prompt or Windows PowerShell or something else to run setup.py install?

janissl avatar Dec 28 '17 23:12 janissl

It may be also useful to look here.

janissl avatar Jan 02 '18 11:01 janissl

To install polyglot in Windows using a Python 3.6 or Python 3.7 you will need a wheel for two dependencies:

You need to download them and then install them with pip from your local machine.

Here you will found many unofficial python builds: https://www.lfd.uci.edu/~gohlke/pythonlibs/

In both cases you will need be able to choose the right version of the build for your windows version and your python version.

It's easy, for example for PyICU:

PyICU wraps the ICU (International Components for Unicode) library.

PyICU‑2.3.1‑cp27‑cp27m‑win32.whl
PyICU‑2.3.1‑cp27‑cp27m‑win_amd64.whl
PyICU‑2.3.1‑cp35‑cp35m‑win32.whl
PyICU‑2.3.1‑cp35‑cp35m‑win_amd64.whl
PyICU‑2.3.1‑cp36‑cp36m‑win32.whl
PyICU‑2.3.1‑cp36‑cp36m‑win_amd64.whl
PyICU‑2.3.1‑cp37‑cp37m‑win32.whl
PyICU‑2.3.1‑cp37‑cp37m‑win_amd64.whl

the 27 means Python 2.7 and the 36 Python 3.6... If you have 64 bits python and windows then choose the amd64 otherwhise the win32 version.

Once you have download them you will need to install it using pip in your python environment:

In my case: python -m pip install C:\Users\Administrator\Downloads\pycld2-0.31-cp37-cp37m-win_amd64.whl python -m pip install C:\Users\Administrator\Downloads\PyICU-2.3.1-cp37-cp37m-win_amd64.whl

RNogales94 avatar May 15 '19 10:05 RNogales94