【问题标题】:pip: understand missing libraries dumppip:了解缺少的库转储
【发布时间】:2014-05-14 05:41:26
【问题描述】:

我正在尝试在 Windows 7 上安装 HoneyProxy。我已经安装了 Python 2.7 和 pip。它说,

安装所有依赖项:pip install pyOpenSSL pyasn1 Twisted 高速公路

Windows 用户:安装 pyOpenSSL 和 Twisted 的二进制文件 手动。

我的点子列表,

astropy (0.3.1)
autobahn (0.8.8)
beautifulsoup4 (4.3.2)
cffi (0.8.2)
cryptography (0.4)
httplib2 (0.8)
matplotlib (1.3.1)
numpy (1.8.1)
oauth2 (1.5.211)
oauthlib (0.6.0)
pip (1.5.4)
pyasn1 (0.1.7)
pycparser (2.10)
pyopenssl (0.14)
pyparsing (2.0.1)
python-dateutil (2.2)
pytz (2014.2)
requests (2.2.1)
requests-oauthlib (0.4.0)
setuptools (3.4.4)
simplejson (3.3.2)
six (1.6.1)
Twisted (14.0.0)
TwitterAPI (2.1.13)
urwid (1.2.1)
wikipedia (1.1dev)
wsgiref (0.1.2)
zope.interface (4.1.1)

我已经手动安装了pyOpenSLLTwisted。尝试执行 python honeyproxy.py 时的转储,

D:\arbol\documentos\phyton\honeyproxy>python honeyproxy.py
Traceback (most recent call last):
  File "honeyproxy.py", line 21, in <module>
    from twisted.web.server import Site
  File "C:\Python27\lib\site-packages\twisted\web\server.py", line 35, in <module>
    from twisted.web import iweb, http, html
  File "C:\Python27\lib\site-packages\twisted\web\http.py", line 95, in <module>
    from twisted.internet import interfaces, reactor, protocol, address
  File "C:\Python27\lib\site-packages\twisted\internet\reactor.py", line 38, in <module>
    from twisted.internet import default
  File "C:\Python27\lib\site-packages\twisted\internet\default.py", line 56, in <module>
    install = _getInstallFunction(platform)
  File "C:\Python27\lib\site-packages\twisted\internet\default.py", line 50, in _getInstallFunction
    from twisted.internet.selectreactor import install
  File "C:\Python27\lib\site-packages\twisted\internet\selectreactor.py", line 18, in <module>
    from twisted.internet import posixbase
  File "C:\Python27\lib\site-packages\twisted\internet\posixbase.py", line 24, in <module>
    from twisted.internet import error, udp, tcp
  File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 29, in <module>
    from twisted.internet._newtls import (
  File "C:\Python27\lib\site-packages\twisted\internet\_newtls.py", line 21, in <module>
    from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
  File "C:\Python27\lib\site-packages\twisted\protocols\tls.py", line 41, in <module>
    from OpenSSL.SSL import Error, ZeroReturnError, WantReadError
  File "build\bdist.win32\egg\OpenSSL\__init__.py", line 8, in <module>
  File "build\bdist.win32\egg\OpenSSL\rand.py", line 11, in <module>
  File "build\bdist.win32\egg\OpenSSL\_util.py", line 4, in <module>
  File "C:\Python27\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 87, in __init__
    self._ensure_ffi_initialized()
  File "C:\Python27\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 106, in _ensure_ffi_initial
ized
    libraries=libraries,
  File "C:\Python27\lib\site-packages\cryptography\hazmat\bindings\utils.py", line 80, in build_ffi
    extra_link_args=extra_link_args,
  File "C:\Python27\lib\site-packages\cffi\api.py", line 341, in verify
    lib = self.verifier.load_library()
  File "C:\Python27\lib\site-packages\cffi\verifier.py", line 75, in load_library
    return self._load_library()
  File "C:\Python27\lib\site-packages\cffi\verifier.py", line 151, in _load_library
    return self._vengine.load_library()
  File "C:\Python27\lib\site-packages\cffi\vengine_cpy.py", line 138, in load_library
    raise ffiplatform.VerificationError(error)
cffi.ffiplatform.VerificationError: importing 'C:\\Python27\\lib\\site-packages\\cryptography\\_Cryptography_cffi_444d73
97xa22f8491.pyd': DLL load failed: El sistema operativo no puede ejecutar %1.

听起来像 cffi 或密码学库失败了,我不知道是哪一个。也有 OpenSLL 和 Twisted?

编辑:最后,我必须安装

【问题讨论】:

    标签: python windows pip


    【解决方案1】:

    基于该堆栈,Twisted 正在尝试初始化其TCP 层,该层依次调用OpenSSL,最终调用cffi 代码,这是Python 和C 之间的桥梁接口代码。

    它正在尝试加载 C:\Python27\lib\site-packages\cryptography\_Cryptography_cffi_444d7397xa22f8491.pyd 文件(本质上是一个 Python-ready DLL)并且由于错误而无法加载就是这么说的。 (看起来它没有在错误字符串中插入一个占位符,这是不幸的,因为这可能提供了额外的信息——除此之外,消息只是操作系统无法加载文件,这不是很多诊断,因为这可能是由于许多不同的原因而发生的)。

    首先要检查的是该文件是否确实存在于您的机器上。如果没有,可能是cffi 的安装没有正常工作。如果它确实存在,那么它只是无法加载它。 Windows Event Log(在它的一种观点中)可能会更清楚地说明 Windows 无法加载 pyd/DLL 的原因。

    ** 编辑 **

    这可能是 32 位与 64 位的问题。请参阅此常见问题解答: https://cryptography.io/en/latest/faq/#when-i-try-to-use-cryptography-on-windows-i-get-a-cffi-ffiplatform-verificationerror

    我建议尝试安装 64 位版本(假设您使用的是 Win64)。

    【讨论】:

    • 感谢您的详细解答!文件 C:\Python27\lib\site-packages\cryptography_Cryptography_cffi_444d7397xa22f8491.pyd 存在 (389kb)。再次收到错误后,我在窗口事件日志中找不到任何内容。我查看了系统和应用程序视图
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多