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 5599: ordinal not in range(128) #87

Closed
lmvasque opened this issue Jun 19, 2021 · 2 comments

Comments

@lmvasque
Copy link

Hi!

I've just downloaded this repo for installation and I got the ascii-related encoding error:

$ pip install .
Processing /tmp/easse
    ERROR: Command errored out with exit status 1:
     command: (..)/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-5iyt237l/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-5iyt237l/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-9kwmmcl4
         cwd: /tmp/pip-req-build-5iyt237l/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-5iyt237l/setup.py", line 5, in <module>
        long_description = f.read()
      File "(..)/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 5599: ordinal not in range(128)

This is fixed by adding "encoding='utf-8'" to the following lines in the setup.py script:

with open("README.md", "r", encoding='utf-8') as f:
    long_description = f.read()

with open("requirements.txt", "r", encoding='utf-8') as f:
    requirements = f.read().strip().split("\n")

In case someone else gets the same error, it would be great to update it :)

Best,

Laura

@louismartin
Copy link
Collaborator

Hi Laura, thank you for the comment, I'll update it right away!

@Obsinaan
Copy link

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

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

No branches or pull requests

3 participants