I am trying to follow the example on page 5 of the book: Mining the Social Web, from O'Reilly. I am coming across the following error:
>>> import twitter
>>> twitter_api = twitter.Twitter(domain="api.twitter.com", api_version='1')
Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'Twitter'
What might be going on?
Check the value of twitter.__file__
(after you've imported twitter). My guess is either you somehow got a broken version of twitter, or you've created a file called twitter.py in the same directory you're running from that's blocking the installed module from loading.
If twitter.__file__
looks good (points to where your installed modules should be instead of the local dir), try easy_install -U twitter
to reinstall it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With