Python error Unicodedecodeerror:ascii codec can t decode byte 0xe0 ... Workaround

Source: Internet
Author: User

Always error when installing webpy with command (Python setup.py install)

The solutions found on the Internet are as follows:

1. This is a Python 2 mimetypes bug

2. You need to comment or delete the following fragment in the python2.7/lib/mimetypes.py file:

Try
CType = Ctype.encode (default_encoding) # Omit in 3.x!
Except Unicodeencodeerror:
Pass

Additional Solutions

Workaround:

Add code to the error page: Import sys
Reload (SYS)
Sys.setdefaultencoding (' UTF8 ')

Execute Python ez_setup.py, error:

Unicodedecodeerror: ' UTF8 ' codec can ' t decode byte 0xb0 in position 35:invalid
Start byte

Workaround:

Add code to the error page: Import sys
Reload (SYS)
Sys.setdefaultencoding (' GB18030 ')

Then execute the Python ez_setup.py and succeed.

Python error Unicodedecodeerror:ascii codec can t decode byte 0xe0 ... Workaround

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.