I am getting an AttributeError: module 'tweepy' has no attribute 'TweepError'. Here is my relevant code in Python:

except tweepy.TweepError as e: msg = 'Query failed when max_id equaled {0}: {1}'.format(max_id, e) logging.error(msg) 

my other code with tweepy is working so I'm sure I've installed it correctly, and it seems that tweep error is included in the current documentation.

2 Answers

The correct exception is tweepy.errors.TweepError, so change that line to:

except tweepy.errors.TweepError as e: 

in older versions of Tweepy, it was previously:

except tweepy.error.TweepError as e: 
2

I tried solutions above but as of 24th of May, this one works for me:

except AttributeError: 

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy