UnboundLocalError: local variable 's' referenced before assignment
Closed this issue · 3 comments
tluyben commented
In tweetfeels.py I always get this error on the
return s
There is data (I can print it and there are many tweets with the subjects i'm looking at) and sentiments is a generator returned, but it never gives a next. What could be wrong?
tluyben commented
Think I found the answer; you need to unzip and manually copy the vader lexicon txt file into your working directory if you are under Windows, otherwise the sentiment is always 0 and it throws those away.
uclatommy commented
Thanks for reporting and testing. I am currently traveling so don't have windows machine readily available to test. However, feel free to send a pull request if you end up making any changes.
DhavalThkkar commented
I have this error in Ubuntu. Whenever I try to run trump_feels.sentiment.values
I always get UnboundLocalError: local variable 's' referenced before assignment
.