Proper installation of pyOpenSSL for Python (Windows)

I am trying to create an application that automatically updates the Google Plus spreadsheet. For this I had to configure gspread, which also requires pyOpenSSL. Without this, it throws this error:

CryptoUnavailableError: cryptocommand library unavailable

Using pip, I type the command:

pip install pyopenssl

And import using:

from OpenSSL import SSL

When I try to run the code, I get the following error:

ImportError: no module named cryptography.hazmat.bindings.openssl.binding

I tried reinstalling pyOpenSSL several times, and also tried reinstalling the cryptography dependency (as well as trying to install previous versions of pyOpenSSL).

, , , - python .

? .

+6
2

. ImportError Windows .

ImportError cryptography.hazmat.bindings.openssl.binding, . - ImportError .

, , -

python -v -c "from OpenSSL import SSL"

. , .

:

  • cffi ( pip install, ...)
  • , DLL SSL, ( pip, )
  • DLL , , - DLL, , , .

. , - , - module.pyd Dependency Walker. - (, DLL, ).

!

+1

Ubuntu. , , Linux Windows

PyOpenSSL 14.x + cffi, , - cffi libffi ( libffi-dev), -Python.

sudo apt-get install python-dev python-pip libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev

pip install cryptography

, libffi-dev.. apt-get, pip install,

pyOpenSSL

" ". , 100% , , , , .

,

-3

Source: https://habr.com/ru/post/1627500/


All Articles