I am trying to follow this basic example here .
Code
import twitter
CONSUMER_KEY = ''
CONSUMER_SECRET =''
OAUTH_TOKEN = ''
OAUTH_TOKEN_SECRET = ''
auth = twitter.oauth.OAuth(OAUTH_TOKEN, OAUTH_TOKEN_SECRET,
CONSUMER_KEY, CONSUMER_SECRET)
twitter_api = twitter.Twitter(auth=auth)
print twitter_api
But running the example causes the following error.
vagrant@lucid32:~$ python twitter.py
Traceback (most recent call last):
File "twitter.py", line 1, in <module>
import twitter
File "/home/vagrant/twitter.py", line 14, in <module>
auth = twitter.oauth.OAuth(OAUTH_TOKEN, OAUTH_TOKEN_SECRET,
AttributeError: 'module' object has no attribute 'oauth'
Any help would be appreciated.
source
share