freebase not working in python
Question: Im trying to run freebase using python on Ubuntu 12.10 the first time. here's
what i did

    
    
    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)
    

Here's that error i got

Traceback (most recent call last): File "", line 1, in File
"/usr/local/lib/python2.7/dist-
packages/freebase-1.0.8-py2.7.egg/freebase/api/session.py", line 597, in
mqlread r = self._httpreq_json(service, 'POST', form=dict(query=qstr)) File
"/usr/local/lib/python2.7/dist-
packages/freebase-1.0.8-py2.7.egg/freebase/api/session.py", line 420, in
_httpreq_json resp, body = self._httpreq(*args, **kws) File
"/usr/local/lib/python2.7/dist-
packages/freebase-1.0.8-py2.7.egg/freebase/api/session.py", line 406, in
_httpreq return self._http_request(url, method, body, headers) File
"/usr/local/lib/python2.7/dist-
packages/freebase-1.0.8-py2.7.egg/freebase/api/httpclients.py", line 66, in
**call** self.log.error('SOCKET FAILURE: %s', e.fp.read()) AttributeError:
'error' object has no attribute 'fp'

Could anyone help me resolve this?

Thansk in advance


Answer: If you're using the old Python client library it won't work because Google
never migrated it to work with the new APIs. You'll need to use the standard
Google APIs Python library and the discovery interface.

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

