本文介绍了CryptoUnavailableError:没有加密库可用,并且来自oauth2client导入crypt失败。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误在gspread认证中。得到

oauth2client.client.CryptoUnavailableError:没有加密库可用



我已经安装了pyOpenSSL和pycrypto。在我的app目录中安装pycrypto后获得Crypto文件夹。
我深入探讨了为什么上述错误仍然存​​在。我从oauth2client import crypt

发现了

是原因。正在引发以下ImportError。



ImportError:找不到加密库。请安装PyOpenSSL或PyCrypto 2.6或更高版本



请帮忙。我早些时候(几个月前)通过在我的app.yaml中添加以下内容来解决这个问题。但是这次它不起作用。

 库:

- 名称:pycrypto
版本:latest

- name:ssl
version:latest

我使用mac开发如果你需要这个帮助我。事情是使用oauth2client正确使用gspread工作。今天我试图安装谷歌云存储客户端。我可能在安装过​​程中做了一些未知的事情。之后,gspread认证保持失败。我不知道下一步该怎么做。



但请注意,gspread身份验证在生产中完美无缺。我通过拉取生产代码进行验证。

解决方案


通过重新安装pyOpenSSL,加密技术解决了这个问题。

  ImportError:没有模块名为cryptography.hazmat.bindings._openssl 


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.

解决方案

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

这篇关于CryptoUnavailableError:没有加密库可用,并且来自oauth2client导入crypt失败。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 06:56