lazy_import icon indicating copy to clipboard operation
lazy_import copied to clipboard

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 621: ordinal not in range(128)

Open AndyBryson opened this issue 6 years ago • 5 comments

Collecting lazy_import
  Downloading https://files.pythonhosted.org/packages/44/2e/5378f9b9cbc893826c2ecb022646c97ece9efbaad351adf89425fff33990/lazy_import-0.2.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-084ivfpp/lazy-import/setup.py", line 6, in <module>
        readme = infile.read()
      File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 621: ordinal not in range(128)

On some systems pip install lazy_import fails with the above error. I guess they're not defaulting to UTF-8 decoding.

AndyBryson avatar Jan 30 '19 08:01 AndyBryson

Having the same issue, have anybody solved this one?

SEFI2 avatar Feb 07 '19 02:02 SEFI2

I solved it in the attached pull request. I'm pretty sure the CI failures on that are due to issues with the CI system rather than a fairly simple code change.

AndyBryson avatar Feb 07 '19 07:02 AndyBryson

Thanks!

SEFI2 avatar Feb 12 '19 08:02 SEFI2

Just going to add what worked for me here:

curl https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt | LC_ALL=C.UTF-8 xargs -n 1 -L 1 pip3 install

The difference is in the LC_ALL=C.UTF-8 part, which suppressed the error.

blandre avatar Jun 27 '20 12:06 blandre

git clone https://github.com/mnmelo/lazy_import cd lazy_import

and open setup.py using any editor and change this line

with open('README.rst') as infile: readme = infile.read()

to

with open('README.rst', encoding='your encoding') as infile: readme = infile.read()

and pip install . (in lazy_import directory)

in my case your encoding = cp949

in your case this might be work... your encoding = ascii

khm159 avatar Oct 15 '20 06:10 khm159