gpt4 book ai didi

python - "TypeError: cannot instantiate ctype ' EVP_MD_CTX ' of unknown size"尝试构建谷歌预测 api

转载 作者:太空宇宙 更新时间:2023-11-04 00:42:44 24 4
gpt4 key购买 nike

下面是代码

import httplib2, argparse, os, sys, json
from oauth2client import tools, file, client
from oauth2client.service_account import ServiceAccountCredentials
from googleapiclient import discovery
from googleapiclient.errors import HttpError

scope = ['https://www.googleapis.com/auth/prediction','https://www.googleapis.com/auth/devstorage.read_only']

def get_api(api, scope, service_account=True):
storage = file.Storage('oAuth2.json')
creds = storage.get()

if creds is None or creds.invalid:
creds = ServiceAccountCredentials.from_json_keyfile_name('service_account.json',
scopes=scope)
storage.put(creds)

http = creds.authorize(httplib2.Http())
return discovery.build(api, 'v1.6', http=http)

api = get_prediction_api('prediction')

错误如下

TypeError: cannot instantiate ctype 'EVP_MD_CTX' of unknown size

基于此blog

使用这个 google-api-python-client

最佳答案

我找到了这篇文章 oauth2client关于这个问题,就我而言,问题已解决,在撰写本文时更新到最新版本的 pyOpenSSL,16.2.0。

关于python - "TypeError: cannot instantiate ctype ' EVP_MD_CTX ' of unknown size"尝试构建谷歌预测 api,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41175403/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com