下面是代码“类型错误:不能实例未知大小的CTYPE 'EVP_MD_CTX'” 而试图建立谷歌Prediction API进行
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')
下面是在此基础上blog
错误TypeError: cannot instantiate ctype 'EVP_MD_CTX' of unknown size
你有参考吗? [github页面](https://github.com/google/google-api-python-client)表示它与Python 3.4完全兼容,并且'此库可能适用于更高版本的3,但我们目前不运行测试反对这些版本。“我只是感到惊讶,它会在3.4而不是3.5 – User
嗯我有类似的经验,这个错误确实消失了,当我尝试Python 2.7 – User
其实我现在在Anaconda Python 3.5.2 。不幸的是,我没有确切的步骤,但我相信它是'pip install pyopenssl'并确保设置了'GOOGLE_APPLICATION_CREDENTIALS' – User