2

I am new to python and trying to make a program which pots tweets on a particular user's timeline I am clueless on debugging this. Not much help online. This looks simple enough, not sure why it is not working. Any help will be greatly appreciated. I am using python 2.7.3

consumer_token = ''
consumer_secret = ''
access_token = ''
access_secret = ''

auth = tweepy.OAuthHandler(consumer_token,consumer_secret)
auth.set_access_token(access_token,access_secret)

api  = tweepy.API(auth)
print api.me().name
api.update_status('Hello -tweepy + oauth!')

I tried suggestions from this post Error using api.update_status method in tweepy using Oauth2

File "C:\Python27\tweet_fetch.py", line 22, in twitter_fetch
    print api.me().name
File "C:\Python27\Lib\tweepy-1.2\tweepy\api.py", line 303, in me
    raise TweepError('Failed to fetch username: %s' % e)
TweepError: Failed to fetch username: Twitter error response: status code = 301

1 Answer 1

1

This was a bug in tweepy-1.2 version. Just upgrade to the latest (2.0) tweepy version:

pip install tweepy --upgrade

or

pip uninstall tweepy
pip install tweepy

Hope that helps.

Sign up to request clarification or add additional context in comments.

1 Comment

I don't have pip installed. But, I manually downloaded tweepy library and updated it. Auth is working now. Thanks a ton!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.