gpt4 book ai didi

Python easy_install : UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in position 11

转载 作者:太空宇宙 更新时间:2023-11-04 03:51:10 25 4
gpt4 key购买 nike

在尝试安装 ez_install、Windows 7 64 位机器和全新的 Python 2.7 时出现以下错误。有什么想法吗?

Installing SetuptoolsTraceback (most recent call last):  File "setup.py", line 17, in     exec(init_file.read(), command_ns)  File "", line 8, in   File "c:\users\namar\appdata\local\temp\tmp1tanvy\setuptools-2.1\setuptools\__init__.py", line 11, in     from setuptools.extension import Extension  File "c:\users\namar\appdata\local\temp\tmp1tanvy\setuptools-2.1\setuptools\extension.py", line 5, in     from setuptools.dist import _get_unpatched  File "c:\users\namar\appdata\local\temp\tmp1tanvy\setuptools-2.1\setuptools\dist.py", line 15, in     from setuptools.compat import numeric_types, basestring  File "c:\users\namar\appdata\local\temp\tmp1tanvy\setuptools-2.1\setuptools\compat.py", line 19, in     from SimpleHTTPServer import SimpleHTTPRequestHandler  File "c:\python27\lib\SimpleHTTPServer.py", line 27, in     class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):  File "c:\python27\lib\SimpleHTTPServer.py", line 208, in SimpleHTTPRequestHandler    mimetypes.init() # try to read system mime.types  File "c:\python27\lib\mimetypes.py", line 358, in init    db.read_windows_registry()  File "c:\python27\lib\mimetypes.py", line 258, in read_windows_registry    for subkeyname in enum_types(hkcr):  File "c:\python27\lib\mimetypes.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\namar\Downloads>cd\C:\>cd Python27

最佳答案

我遇到了同样的问题,通过删除窗口注册表“HKEY_CLASSES_ROOT\MIME\Database\Content Type”中的非 ASCII 字符解决了这个问题,它起作用了。原因是

 ctype = ctype.encode(default_encoding)  

遇到非ASCII字符会抛出UnicodeDecodeError,程序会停止。

关于Python easy_install : UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in position 11,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21248225/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com