Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named cryptography.hazmat.bindings._openssl

Tags:

CryptoUnavailableError: No crypto library available and from oauth2client import crypt failure.

I had the above error mentioned in the link. I was able to fix that by reinstalling pyOpenSSL and cryptography. But now the following error is being raised.

ImportError: No module named cryptography.hazmat.bindings._openssl

Here _openssl is a unix executable file(_openssl.so). The following is the import statement

from cryptography.hazmat.bindings._openssl import ffi, lib

The above code is in bindings.py in cryptography module. These are all linked to gspread authentication using oauth2client. Please help me out. Im struggling with this.

Update: The issue was caused by some dependency failure. I was unable to find where the dependency was failing though.. Reinstalled all the libraries from top. That kind of fixed the issue.

like image 946
Prajapathy3165 Avatar asked Sep 11 '15 07:09

Prajapathy3165


2 Answers

I finally got this. It worked for me:

pip uninstall pyopenssl
pip uninstall cryptography
pip install pyopenssl
pip install cryptography
like image 62
zhangzhy2000 Avatar answered Oct 07 '22 19:10

zhangzhy2000


Installing it via the venv fixed it for me:

/opt/eff.org/certbot/venv/local/bin/pip install cryptography interface
like image 35
rix Avatar answered Oct 07 '22 17:10

rix