V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
wuchujie
V2EX  ›  问与答

python 安装第三方库的时候出现 UnicodeDecodeError: 'utf8'

  •  1
     
  •   wuchujie · 2014-08-24 23:32:00 +08:00 · 7773 次点击
    这是一个创建于 3748 天前的主题,其中的信息可能已经有所发展或是发生改变。
    新手。请指导。感激不尽。无以为报

    1. pip – http://pypi.python.org/pypi/pip
    2. distribute – http://pypi.python.org/pypi/distribute
    3. nose – http://pypi.python.org/pypi/nose/
    4. virtualenv – http://pypi.python.org/pypi/virtualenv

    安装4个包。
    期间安装了easy_install , 就是setuptools

    用下载压缩包加压 Powershell 输入 python setup.py install 这个方法安装 提示
    PS C:\Users\Jerry-Wu\pythonku\nose-1.3.3> python setup.py install
    Traceback (most recent call last):
    File "setup.py", line 27, in <module>
    from setup3lib import setup
    File "C:\Users\Jerry-Wu\pythonku\nose-1.3.3\setup3lib.py", line 2, in <module>
    from setuptools import setup as _setup
    File "C:\Python27\lib\site-packages\setuptools\__init__.py", line 2, in <module>
    from setuptools.extension import Extension, Library
    File "C:\Python27\lib\site-packages\setuptools\extension.py", line 5, in <module>
    from setuptools.dist import _get_unpatched
    File "C:\Python27\lib\site-packages\setuptools\dist.py", line 15, in <module>
    from setuptools.compat import numeric_types, basestring
    File "C:\Python27\lib\site-packages\setuptools\compat.py", line 19, in <module>
    from SimpleHTTPServer import SimpleHTTPRequestHandler
    File "C:\Python27\lib\SimpleHTTPServer.py", line 27, in <module>
    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!
    File "C:\Python27\lib\encodings\utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
    UnicodeDecodeError: 'utf8' codec can't decode byte 0xb0 in position 1: invalid start byte
    PS C:\Users\Jerry-Wu\pythonku\nose-1.3.3>


    用easy_install nose 提示为
    PS C:\Users\Jerry-Wu\pythonku\nose-1.3.3> easy_install nose
    Traceback (most recent call last):
    File "C:\Python27\Scripts\easy_install-script.py", line 9, in <module>
    load_entry_point('setuptools==1.1', 'console_scripts', 'easy_install')()
    File "C:\Python27\lib\site-packages\pkg_resources.py", line 357, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
    File "C:\Python27\lib\site-packages\pkg_resources.py", line 2394, in load_entry_point
    return ep.load()
    File "C:\Python27\lib\site-packages\pkg_resources.py", line 2108, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
    File "C:\Python27\lib\site-packages\setuptools\__init__.py", line 2, in <module>
    from setuptools.extension import Extension, Library
    File "C:\Python27\lib\site-packages\setuptools\extension.py", line 5, in <module>
    from setuptools.dist import _get_unpatched
    File "C:\Python27\lib\site-packages\setuptools\dist.py", line 15, in <module>
    from setuptools.compat import numeric_types, basestring
    File "C:\Python27\lib\site-packages\setuptools\compat.py", line 19, in <module>
    from SimpleHTTPServer import SimpleHTTPRequestHandler
    File "C:\Python27\lib\SimpleHTTPServer.py", line 27, in <module>
    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 0xb0 in position 1: ordinal not in range(128)
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1037 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 22:06 · PVG 06:06 · LAX 14:06 · JFK 17:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.