【问题标题】:setuptools ez_setup return me UnicodeDecodeErrorsetuptools ez_setup 返回我 UnicodeDecodeError
【发布时间】:2014-06-07 10:49:16
【问题描述】:

我正在使用 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。

【问题讨论】:

  • 使用py -3 ez_setup.py。顺便说一句,pip 和 setuptools 包含在 3.4 中。

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


【解决方案1】:

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

我真的不知道我的解释是否属实(因为我的路径上没有 python2),但我知道有些文件只有在使用 IDE 运行时才有效,而有些文件只能在 cmd(或图形)下运行.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-08-26
    • 2016-04-01
    • 2015-04-23
    • 2022-08-08
    • 1970-01-01
    • 2018-07-01
    • 2015-06-19
    相关资源
    最近更新 更多