This appears to be a very common error with a few different solutions, python: UnboundLocalError: local variable 'open' referenced before assignment
Python: Help with UnboundLocalError: local variable referenced before assignment
Where my question is different is that I don’t have a variable "resp" in the code I am running. Most of the other questions were posted because the poster used the same name for a class and variable or they failed to declare it as a global variable.
The Code
import tweepy
auth = tweepy.OAuthHandler('75VSSMGC4pfUB5u0Zt5G3Q', '2olQeiquDg71uwnGoU2c9e2u3qy2LrKkn2p6KWBIdI')
auth.set_access_token('122095773-cCrYa4FWFoBkx44LES8yeBlt8DTG0jnZivJ79k2J', 'p1Nmp9DaPUIThpTamzIMfdvJu0wgdfxmghdwsSagM')
api = tweepy.API(auth)
print api.rate_limit_status()
#print tweepy.api.rate_limit_status()
The Error
Traceback (most recent call last):
File "/Users/brendan/Documents/workspace/Tweeter/src/rate_limit.py", line 6, in <module>
print api.rate_limit_status()
File "build/bdist.macosx-10.5-fat3/egg/tweepy/binder.py", line 185, in _call
File "build/bdist.macosx-10.5-fat3/egg/tweepy/binder.py", line 147, in execute
UnboundLocalError: local variable 'resp' referenced before assignment
Any suggestions?