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

点点圈 提交于 2019-12-07 23:51:36

问题


The error is in gspread authentication. Got

oauth2client.client.CryptoUnavailableError: No crypto library available

I have installed both pyOpenSSL and pycrypto. With the Crypto folder obtained after installation of pycrypto in my app directory. I dug deeper on why the above error still persists. I found

from oauth2client import crypt

to be the cause. The following ImportError is being raised.

ImportError: No encryption library found. Please install either PyOpenSSL, or PyCrypto 2.6 or later

Please help. I earlier(few months ago) got it working by adding the following in my app.yaml. But this time it is not working.

libraries:

- name: pycrypto
  version: "latest"

- name: ssl
  version: latest  

I use mac for development in case you need this to help me out. The thing is gspread used properly work using oauth2client. Today i tried to install google cloud storage client. I might have done something unknowningly during the installation process. After which the gspread authentication keeps failing. I have no clue on what to do next.

But note that the gspread authentication works flawlessly on production. I verified by pulling the production code.


回答1:


I was able to fix this issue by reinstalling pyOpenSSL, cryptography.

But now i got another error.

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

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



来源:https://stackoverflow.com/questions/32508080/cryptounavailableerror-no-crypto-library-available-and-from-oauth2client-import

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!