在python 2.7.6上安装setuptools时出现异常 [英] exception when installing setuptools on python 2.7.6

查看:247
本文介绍了在python 2.7.6上安装setuptools时出现异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7 64位机器上安装Python 2.7.6的安装工具,并获得以下错误

I'm installing setuptools for Python 2.7.6 on Windows 7 64-bit machine and get the following error

C:\Python27\install_scripts>python ez_setup.py
Extracting in c:\users\p\appdata\local\temp\tmpqhpyyh
Now working in c:\users\p\appdata\local\temp\tmpqhpyyh\setuptools-2.1
Installing Setuptools
Traceback (most recent call last):
  File "setup.py", line 17, in <module>
    exec(init_file.read(), command_ns)
  File "<string>", line 8, in <module>
  File "c:\users\p\appdata\local\temp\tmpqhpyyh\setuptools-2.1\setuptools\__init__.py", line 11, in <module>
    from setuptools.extension import Extension
  File "c:\users\p\appdata\local\temp\tmpqhpyyh\setuptools-2.1\setuptools\extension.py", line 5, in <module>
    from setuptools.dist import _get_unpatched
  File "c:\users\p\appdata\local\temp\tmpqhpyyh\setuptools-2.1\setuptools\dist.py", line 15, in <module>
    from setuptools.compat import numeric_types, basestring
  File "c:\users\p\appdata\local\temp\tmpqhpyyh\setuptools-2.1\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 0xf4 in position 1: ordinal not in range(128)
Something went wrong during the installation.
See the error message above.

我该如何解决?之前我安装了用于Python 3.4 beta的安装工具,它安装正常。

How can I fix this? Before I install setuptools for Python 3.4 beta and it was installed fine.

推荐答案

这是因为一些内部Python 2.7发生的问题。 6个问题尝试安装 2.7.5 - 它应该可以正常工作。 这是关于python bug跟踪器的问题的错误报告。

That's the problem occurred because of some internal Python 2.7.6 issue. Try to install 2.7.5 - it should work fine. That's a bug report for that problem on python bug tracker.

这篇关于在python 2.7.6上安装setuptools时出现异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆