【问题标题】:Error while installing python setuptools for compiling pyOpenSSL安装用于编译 pyOpenSSL 的 python setuptools 时出错
【发布时间】:2014-04-16 17:06:27
【问题描述】:

我想使用我已经下载并尝试构建的 pyOpenSSL,但是我在使用 setuptools 时遇到了问题。 首先我下载了​​just python并使用它没有成功,但现在我尝试了WinPython并得到了相同的结果,即:

    Traceback (most recent call last):
  File "setup.py", line 11, in <module>
    from setuptools import setup
  File "C:\Users\User\Downloads\WinPython-32bit-2.7.6.3\python-2.7.6\lib\site-packages\setuptools\__init_
_.py", line 11, in <module>
    from setuptools.extension import Extension
  File "C:\Users\User\Downloads\WinPython-32bit-2.7.6.3\python-2.7.6\lib\site-packages\setuptools\extensi
on.py", line 5, in <module>
    from setuptools.dist import _get_unpatched
  File "C:\Users\User\Downloads\WinPython-32bit-2.7.6.3\python-2.7.6\lib\site-packages\setuptools\dist.py
", line 15, in <module>
    from setuptools.compat import numeric_types, basestring
  File "C:\Users\User\Downloads\WinPython-32bit-2.7.6.3\python-2.7.6\lib\site-packages\setuptools\compat.
py", line 19, in <module>
    from SimpleHTTPServer import SimpleHTTPRequestHandler
  File "C:\Users\User\Downloads\WinPython-32bit-2.7.6.3\python-2.7.6\lib\SimpleHTTPServer.py", line 27, i
n <module>
    class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
  File "C:\Users\User\Downloads\WinPython-32bit-2.7.6.3\python-2.7.6\lib\SimpleHTTPServer.py", line 208,
in SimpleHTTPRequestHandler
    mimetypes.init() # try to read system mime.types
  File "C:\Users\User\Downloads\WinPython-32bit-2.7.6.3\python-2.7.6\lib\mimetypes.py", line 358, in init

    db.read_windows_registry()
  File "C:\Users\User\Downloads\WinPython-32bit-2.7.6.3\python-2.7.6\lib\mimetypes.py", line 260, in read
_windows_registry
    with _winreg.OpenKey(hkcr, subkeyname) as subkey:
TypeError: must be string without null bytes or None, not str

我已经使用 PyCharm 安装了 Python 2.7.6,但没有成功,并且还尝试了 WinPython,结果相同。 我正在运行 Windows 7 x64。

【问题讨论】:

    标签: python


    【解决方案1】:

    这与 Python 2.7.6 中的一个错误有关,与 Windows 注册表损坏有关。

    某些程序(错误地)将终止的 null 写入注册表项,这会破坏 setuptools。更新 Python 解决了这个问题。

    This blog post

    【讨论】:

      【解决方案2】:

      由于您在安装 setuptools 本身时遇到问题,您可以从this 链接下载 setuptools 的 Windows 二进制文件。 这个网站是一个很棒的存储库,其中包含各种 Python 模块的预编译 Windows 二进制文件。

      如果安装 64 位 Python 不是必须的,我建议你安装 32 位版本的 Python 和其他模块。

      【讨论】:

      • 令人讨厌的是,提供的链接不再包含 Windows 安装程序(二进制文件),而是使用 .WHL 文件
      猜你喜欢
      • 2011-08-09
      • 1970-01-01
      • 2016-03-19
      • 2013-01-18
      • 2015-09-26
      • 2013-12-05
      • 1970-01-01
      • 2020-01-19
      • 2016-01-15
      相关资源
      最近更新 更多