【问题标题】:httplib.ResponseNotReady when using standard Google APIs Python library使用标准 Google API Python 库时的 httplib.ResponseNotReady
【发布时间】:2013-07-01 23:25:10
【问题描述】:

我正在尝试运行 Google API Python 库以使用 freebase API。 我按照此链接中的教程进行操作。

https://developers.google.com/api-client-library/python/start/get_started

当我运行这段代码时。

import freebase
query = {
 "id" :   "/en/the_beatles",
 "type" : "/music/artist",
 "album" : [{
"name" :         None,
"release_date" : None,
"track": {
    "return" : "count"
},
"sort" : "release_date"
}]
}
freebase.mqlread(query)

我收到了这个错误

httplib.ResponseNotReady

谁能帮我解决这个问题?

提前致谢

【问题讨论】:

    标签: python google-app-engine freebase google-api-python-client


    【解决方案1】:

    google-api-python-client 库中没有任何内容支持“import freebase”。看起来您正在使用 https://code.google.com/p/freebase-python/ 已弃用的 freebase 库。

    我建议从您通过使用Quickstart for Freebase 创建的骨架应用程序开始,然后添加以下 Python 代码来进行查询:

    import json
    
    query = {
      "id" :   "/en/the_beatles",
      "type" : "/music/artist",
      "album" : [{
        "name" :         None,
        "release_date" : None,
        "sort" : "release_date",
      }]
    }    
    
    pprint.pprint(service.mqlread(query=json.dumps(query)).execute())
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-09-22
      • 2011-04-17
      • 2011-06-08
      • 2021-12-08
      • 2014-08-25
      • 2016-03-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多