After installing Python2.7 on a Windows 8 machine, it is always the error unicodedecodeerror to download some package packages for Setup, as follows:
File "c:/python27/lib/mimetypes.py", line (in Enum_types)
CType = Ctype.encode (default_encoding) # Omit in 3.x!
Unicodedecodeerror: ' ASCII ' codec can ' t decode byte 0xe0 in position 0:ordinal not in range (128)
The following solutions are available for online search:
1. This is the 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
Complement other solutions
Solution:
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
Solution:
Add code to the error page: Import sys
Reload (SYS)
Sys.setdefaultencoding (' GB18030 ')
Then execute the Python ez_setup.py and succeed.