socialsentiment icon indicating copy to clipboard operation
socialsentiment copied to clipboard

Error with sentiment_fts table

Open ghost opened this issue 7 years ago • 2 comments

I found a error during running twitter_stream.py and dev_server.py like this: pandas.io.sql.DatabaseError: Execution failed on sql 'SELECT sentiment.* FROM sentiment_fts fts LEFT JOIN sentiment ON fts.rowid = sentiment.id WHERE fts.sentiment_fts MATCH ? ORDER BY fts.rowid DESC LIMIT 10': no such table: sentiment_fts

I supposed the cause of this error is in twitter_stream.py when it was creating sentiment_fts table, but I cannot find anything wrong with it. Could anyone please help me with it? fts5 was already enabled.

ghost avatar Mar 30 '18 17:03 ghost

What operating system are you using? You need newest Python 3.6 on Windows, and for Linux you have to update sqlite module (there is info about that in readme)

daniel-kukiela avatar Apr 01 '18 23:04 daniel-kukiela

I hade the same error running on a Mac with Python 3.8.

The solution was to add the current path to the code.

import os
import sys

# set chdir to current dir
sys.path.insert(0, os.path.realpath(os.path.dirname(__file__)))
os.chdir(os.path.realpath(os.path.dirname(__file__)))

stelaninja avatar Jan 01 '20 22:01 stelaninja