setuptools ez_setup返回UnicodeDecodeError

时间:2014-06-07 10:49:17

标签: python-2.7 python-3.x windows-xp setuptools

我使用的是python 3.3和Windows XP(32x) 我试着安装setuptools。 我在命令行中写道:

py ez_setup.py install

它还给我错误:

Traceback (most recent call last):
  File "setup.py", line 19, in <module>
    exec(init_file.read(), command_ns)
  File "<string>", line 8, in <module>
  File "c:\docume~1\jakov\locals~1\temp\tmpymerwg\setuptools-3.5.1\setuptools\_
init__.py", line 12, in <module>
    from setuptools.extension import Extension
  File "c:\docume~1\jakov\locals~1\temp\tmpymerwg\setuptools-3.5.1\setuptools\e
tension.py", line 7, in <module>
    from setuptools.dist import _get_unpatched
  File "c:\docume~1\jakov\locals~1\temp\tmpymerwg\setuptools-3.5.1\setuptools\d
st.py", line 16, in <module>
    from setuptools.compat import numeric_types, basestring
  File "c:\docume~1\jakov\locals~1\temp\tmpymerwg\setuptools-3.5.1\setuptools\c
mpat.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 SimpleHTTPRequestHan
ler
    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 0x9e in position 6: ordinal
not in range(128)
Something went wrong during the installation.
See the error message above. 

我也在使用python 2.7,但我想为python 3.3安装setuptools。

1 个答案:

答案 0 :(得分:0)

我用IDE打开我的文件并运行它(因为如果你从cmd运行代码并且你同时拥有python2和python3它将运行python2,如果你从IDE运行python3它将在python3中运行)。

我真的不知道我的解释是否正确(因为我在路径上没有python2),但我知道有些文件只有在用IDE运行时才有效,有些文件只能用于cmd (或图形)。