pip:了解丢失的库转储

时间:2014-05-14 05:41:27

标签: python windows pip

我正在尝试在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或加密libs失败,我不知道哪一个。 OpenSLL和Twisted呢?

编辑:最后,我必须安装

1 个答案:

答案 0 :(得分:1)

根据该堆栈,Twisted正在尝试初始化其TCP层,而OpenSSL层又调用cffi,最终调用cffi代码,是Python和C代码之间的桥接接口。

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

首先要检查的是该文件是否确实存在于您的计算机上。如果没有,Windows Event Log的安装可能无法正常运行。如果确实存在,则无法加载它。 {{1}} - 在其中一个视图中 - 可能会更清楚地说明为什么Windows无法加载pyd / DLL。

**编辑**

这可能是32位与64位的问题。看这个FAQ: https://cryptography.io/en/latest/faq/#when-i-try-to-use-cryptography-on-windows-i-get-a-cffi-ffiplatform-verificationerror

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