Domanda

I'm trying to install HoneyProxy on Windows 7. I've already have Python 2.7 and pip installed. It says,

Install all dependencies: pip install pyOpenSSL pyasn1 Twisted Autobahn

Windows users: Install the binaries for pyOpenSSL and Twisted manually.

My pip list,

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)

I've installed pyOpenSLL and Twisted manually. My dump when trying to execute 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.

Sounds like cffi or cryptography libs fails, I don't know which one. OpenSLL and Twisted too?

EDIT: Finally, I had to install

È stato utile?

Soluzione

Based on that stack, Twisted is trying to initialize its TCP layer, which in turn is calling into OpenSSL, which ultimately is calling into cffi code, which is a bridge interface between Python and C code.

It's trying to load the C:\Python27\lib\site-packages\cryptography\_Cryptography_cffi_444d7397xa22f8491.pyd file (which is essentially a Python-ready DLL) and is unable to due to the error that is stated. (It looks like it didn't interpolate one of the placeholders in the error string, which is unfortunate, as that could've provided additional information -- aside from that, the message is just that the OS can't load the file, which isn't diagnostic of much, since that could occur for a bunch of different reasons).

The first thing to check would be whether that file actually exists on your machine. If not, it's possible the installation of cffi did not work properly. If it does exist, then it is just not able to load it. It's possible the Windows Event Log -- in one of its views -- may shed some more light as to why Windows couldn't load the pyd/DLL.

** Edit **

It may be an issue of 32-bit vs. 64-bit. See this FAQ: https://cryptography.io/en/latest/faq/#when-i-try-to-use-cryptography-on-windows-i-get-a-cffi-ffiplatform-verificationerror

I would recommend trying to install the 64-bit version (assuming you're using Win64).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top