Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
422 views
in Technique[技术] by (71.8m points)

setuptools - Python ez_install : UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in position 11

Getting the error below trying to install ez_install, Windows 7 64 bit machine with fresh Python 2.7. Any ideas?

Installing Setuptools
Traceback (most recent call last):
  File "setup.py", line 17, in 
    exec(init_file.read(), command_ns)
  File "", line 8, in 
  File "c:users
amarappdatalocalempmp1tanvysetuptools-2.1setuptools\__
init__.py", line 11, in 
    from setuptools.extension import Extension
  File "c:users
amarappdatalocalempmp1tanvysetuptools-2.1setuptoolsex
tension.py", line 5, in 
    from setuptools.dist import _get_unpatched
  File "c:users
amarappdatalocalempmp1tanvysetuptools-2.1setuptoolsdi
st.py", line 15, in 
    from setuptools.compat import numeric_types, basestring
  File "c:users
amarappdatalocalempmp1tanvysetuptools-2.1setuptoolsco
mpat.py", line 19, in 
    from SimpleHTTPServer import SimpleHTTPRequestHandler
  File "c:python27libSimpleHTTPServer.py", line 27, in 
    class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
  File "c:python27libSimpleHTTPServer.py", line 208, in SimpleHTTPRequestHand
ler
    mimetypes.init() # try to read system mime.types
  File "c:python27libmimetypes.py", line 358, in init
    db.read_windows_registry()
  File "c:python27libmimetypes.py", line 258, in read_windows_registry
    for subkeyname in enum_types(hkcr):
  File "c:python27libmimetypes.py", line 249, in enum_types
    ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in position 11: ordinal
 not in range(128)
Something went wrong during the installation.
See the error message above.


C:Users
amarDownloads>cd

C:>cd Python27
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I met the same problem, solved it by deleting non-ASCII character in window registry "HKEY_CLASSES_ROOTMIMEDatabaseContent Type" and it works.The reason is

 ctype = ctype.encode(default_encoding)  

will throw UnicodeDecodeError when it met non-ASCII characters and the program will stop.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...