tweetfeels icon indicating copy to clipboard operation
tweetfeels copied to clipboard

Invalid Syntax

Open dieee opened this issue 7 years ago • 7 comments

File "/usr/local/lib/python3.5/dist-packages/tweetfeels-0.4.0-py3.5.egg/tweetfeels/tweetdata.py", line 146 df = df.groupby(pd.TimeGrouper(freq=f'{int(binsize/second)}S')).size() ^ SyntaxError: invalid syntax

Do you know what can happen? Thanks

dieee avatar Dec 06 '17 15:12 dieee

After update python3.6 the issue continue: /usr/local/lib/python3.6/dist-packages/tweetfeels/tweetdata.py:146: FutureWarning: pd.TimeGrouper is deprecated and will be removed; Please use pd.Grouper(freq=...) df = df.groupby(pd.TimeGrouper(freq=f'{int(binsize/second)}S')).size() Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/lib/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "pruebaSentimientos.py", line 15, in print_feels print(f'[{time.ctime()}] Sentiment Score: {data_feels.sentiment.value}') File "/usr/local/lib/python3.6/dist-packages/tweetfeels/tweetfeels.py", line 133, in sentiment return s UnboundLocalError: local variable 's' referenced before assignment

can anybody help me?

dieee avatar Dec 06 '17 15:12 dieee

t.start()

/usr/local/lib/python3.6/dist-packages/tweetfeels/tweetdata.py:146: FutureWarning: pd.TimeGrouper is deprecated and will be removed; Please use pd.Grouper(freq=...) df = df.groupby(pd.TimeGrouper(freq=f'{int(binsize/second)}S')).size() Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/lib/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "", line 4, in print_feels File "/usr/local/lib/python3.6/dist-packages/tweetfeels/tweetfeels.py", line 133, in sentiment return s UnboundLocalError: local variable 's' referenced before assignment

data_feels.stop() Exception in thread Thread-3: Traceback (most recent call last): File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/lib/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.6/dist-packages/tweetfeels/tweetfeels.py", line 152, in self_update self.sentiment File "/usr/local/lib/python3.6/dist-packages/tweetfeels/tweetfeels.py", line 133, in sentiment return s UnboundLocalError: local variable 's' referenced before assignment

dieee avatar Dec 06 '17 16:12 dieee

Same Error Here

GMarzinotto avatar Dec 28 '17 21:12 GMarzinotto

Had this same error. This can be fixed by editing "/usr/local/lib/python3.6/dist-packages/tweetfeels/tweetdata.py" and changing TimeGrouper to Grouper.

brettkrueger avatar Jan 20 '18 02:01 brettkrueger

I changed TimeGrouper to Grouper and I still receive the same error "UnboundLocalError: local variable 's' referenced before assignment"

Any ideas? :(

Valaia avatar Mar 05 '18 18:03 Valaia

any solution?

datomnurdin avatar Mar 23 '18 04:03 datomnurdin

I just shipped a new version on pypi which should fix this error. To upgrade:

pip uninstall tweepy
pip install tweetfeels --upgrade

Note that it is important to uninstall tweepy as shown by the first line.

Hopefully tweepy will release a new version soon and we can simplify the install complications caused by the upstream bug. If your issues are resolved, I would appreciate a shout back here to let us know so we can get this issue closed.

uclatommy avatar Nov 11 '18 08:11 uclatommy