python twitter Api() not found error
I'm trying to use the python-twitter module, but still having problems initiating the twitter.Api(). I've checked and rechecked that no other file named twitter.py or twitter.pyc is on my system. On a clean install i first try to
>>> import twitter
and correctly get a response of 'module unknown'
I do a easy_install twitter
, successfull.
Then do
>>> import twitter
>>> testapi = twitter.Api()
The response is
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
testapi = twitter.Api()
AttributeError: 'module' object has no attribute 'Api'
>>>
开发者_开发技巧I'm exhausted trying to locate the problem here, please help.
It appears that you are trying to follow the documentation for one Python Twitter module when you are in fact using another Python Twitter module.
The Api()
method call you mention is part of this Python Twitter module. However, when you use easy_install twitter
, you actually get this other Python Twitter module.
精彩评论