Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Syntax #39

Open
dieee opened this issue Dec 6, 2017 · 7 comments
Open

Invalid Syntax #39

dieee opened this issue Dec 6, 2017 · 7 comments
Labels

Comments

@dieee
Copy link

dieee commented Dec 6, 2017

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
Copy link
Author

dieee commented Dec 6, 2017

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
Copy link
Author

dieee commented Dec 6, 2017

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

@GMarzinotto
Copy link

Same Error Here

@brettkrueger
Copy link

brettkrueger commented Jan 20, 2018

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.

@Valaia
Copy link

Valaia commented Mar 5, 2018

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

Any ideas? :(

@datomnurdin
Copy link

any solution?

uclatommy added a commit that referenced this issue Nov 10, 2018
uclatommy pushed a commit that referenced this issue Nov 10, 2018
@uclatommy
Copy link
Owner

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 uclatommy added the bug label Nov 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants