Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AndyBryson opened this issue Jan 30, 2019 · 5 comments · May be fixed by #12

Comments

@AndyBryson
Copy link

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 AndyBryson linked a pull request Jan 30, 2019 that will close this issue
@SEFI2
Copy link

SEFI2 commented Feb 7, 2019

Having the same issue, have anybody solved this one?

@AndyBryson
Copy link
Author

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.

@SEFI2
Copy link

SEFI2 commented Feb 12, 2019

Thanks!

@blandre
Copy link

blandre commented Jun 27, 2020

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.

@khm159
Copy link

khm159 commented Oct 15, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants