ImportError: No module named cryptography.hazmat.b

2019-06-20 16:54发布

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.

9条回答
一夜七次
2楼-- · 2019-06-20 17:55

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.

查看更多
放我归山
3楼-- · 2019-06-20 17:55

I download the file cryptography-2.0.3-cp36-cp36m-win_amd64.whl

and run :

pip install C:/User/Download/cryptography-2.0.3-cp36-cp36m-win_amd64.whl

then it solved.

查看更多
做个烂人
4楼-- · 2019-06-20 18:00

I finally got this. It worked for me:

pip uninstall pyopenssl
pip uninstall cryptography
pip install pyopenssl
pip install cryptography
查看更多
登录 后发表回答